{"action":"created","issue":{"url":"https://api.github.com/repos/FluxNotes/flux/issues/390","repository_url":"https://api.github.com/repos/FluxNotes/flux","labels_url":"https://api.github.com/repos/FluxNotes/flux/issues/390/labels{/name}","comments_url":"https://api.github.com/repos/FluxNotes/flux/issues/390/comments","events_url":"https://api.github.com/repos/FluxNotes/flux/issues/390/events","html_url":"https://github.com/FluxNotes/flux/pull/390","id":346644794,"node_id":"MDExOlB1bGxSZXF1ZXN0MjA1NDU5NjU2","number":390,"title":"NLP Structured Phrase","user":{"login":"Dtphelan1","id":5703736,"node_id":"MDQ6VXNlcjU3MDM3MzY=","avatar_url":"https://avatars3.githubusercontent.com/u/5703736?v=4","gravatar_id":"","url":"https://api.github.com/users/Dtphelan1","html_url":"https://github.com/Dtphelan1","followers_url":"https://api.github.com/users/Dtphelan1/followers","following_url":"https://api.github.com/users/Dtphelan1/following{/other_user}","gists_url":"https://api.github.com/users/Dtphelan1/gists{/gist_id}","starred_url":"https://api.github.com/users/Dtphelan1/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Dtphelan1/subscriptions","organizations_url":"https://api.github.com/users/Dtphelan1/orgs","repos_url":"https://api.github.com/users/Dtphelan1/repos","events_url":"https://api.github.com/users/Dtphelan1/events{/privacy}","received_events_url":"https://api.github.com/users/Dtphelan1/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":{"login":"gregquinn2001","id":20170846,"node_id":"MDQ6VXNlcjIwMTcwODQ2","avatar_url":"https://avatars1.githubusercontent.com/u/20170846?v=4","gravatar_id":"","url":"https://api.github.com/users/gregquinn2001","html_url":"https://github.com/gregquinn2001","followers_url":"https://api.github.com/users/gregquinn2001/followers","following_url":"https://api.github.com/users/gregquinn2001/following{/other_user}","gists_url":"https://api.github.com/users/gregquinn2001/gists{/gist_id}","starred_url":"https://api.github.com/users/gregquinn2001/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gregquinn2001/subscriptions","organizations_url":"https://api.github.com/users/gregquinn2001/orgs","repos_url":"https://api.github.com/users/gregquinn2001/repos","events_url":"https://api.github.com/users/gregquinn2001/events{/privacy}","received_events_url":"https://api.github.com/users/gregquinn2001/received_events","type":"User","site_admin":false},"assignees":[{"login":"gregquinn2001","id":20170846,"node_id":"MDQ6VXNlcjIwMTcwODQ2","avatar_url":"https://avatars1.githubusercontent.com/u/20170846?v=4","gravatar_id":"","url":"https://api.github.com/users/gregquinn2001","html_url":"https://github.com/gregquinn2001","followers_url":"https://api.github.com/users/gregquinn2001/followers","following_url":"https://api.github.com/users/gregquinn2001/following{/other_user}","gists_url":"https://api.github.com/users/gregquinn2001/gists{/gist_id}","starred_url":"https://api.github.com/users/gregquinn2001/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gregquinn2001/subscriptions","organizations_url":"https://api.github.com/users/gregquinn2001/orgs","repos_url":"https://api.github.com/users/gregquinn2001/repos","events_url":"https://api.github.com/users/gregquinn2001/events{/privacy}","received_events_url":"https://api.github.com/users/gregquinn2001/received_events","type":"User","site_admin":false},{"login":"jafeltra","id":30803904,"node_id":"MDQ6VXNlcjMwODAzOTA0","avatar_url":"https://avatars0.githubusercontent.com/u/30803904?v=4","gravatar_id":"","url":"https://api.github.com/users/jafeltra","html_url":"https://github.com/jafeltra","followers_url":"https://api.github.com/users/jafeltra/followers","following_url":"https://api.github.com/users/jafeltra/following{/other_user}","gists_url":"https://api.github.com/users/jafeltra/gists{/gist_id}","starred_url":"https://api.github.com/users/jafeltra/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jafeltra/subscriptions","organizations_url":"https://api.github.com/users/jafeltra/orgs","repos_url":"https://api.github.com/users/jafeltra/repos","events_url":"https://api.github.com/users/jafeltra/events{/privacy}","received_events_url":"https://api.github.com/users/jafeltra/received_events","type":"User","site_admin":false}],"milestone":null,"comments":10,"created_at":"2018-08-01T15:13:58Z","updated_at":"2018-08-10T15:29:52Z","closed_at":null,"author_association":"COLLABORATOR","pull_request":{"url":"https://api.github.com/repos/FluxNotes/flux/pulls/390","html_url":"https://github.com/FluxNotes/flux/pull/390","diff_url":"https://github.com/FluxNotes/flux/pull/390.diff","patch_url":"https://github.com/FluxNotes/flux/pull/390.patch"},"body":"Initial implementation of the nlp mechanism of structured phrases. This PR introduces the #nlptoxicity shortcut and the new `NLPHashtag` shortcut type. The presence of an `NLPHashtag` activates the NLPHashtagPlugin, which looks for a stop character ('.' or '?' or '!') followed by an end character (space or newline). If these characters are found, the plugin sends of the sentence between the `NLPHashtag` these endOfPhraseCharacters to the NLPEngine that Sam Bayer has built (currently this sever is hosted on my machine; I'm in the process of setting it up on the big mac in the lab). This sentence gets parsed and FluxNotes gets the result of this parsing. Should the engine identify phrases that we need to insert, we will find the text in our editor corresponding to each phrase and replace it with structuredPhrase for the appropriate child shortcut. The `ToxicityGradeCreator, ToxicityAdverseEventCreator, and ToxicityAttributionCreator` shortcuts all have had metadata added to them in shortcuts.json in order to specify how to parse the data returned back from the NLPEngine to retrieve the associated shortcut triggers.\r\n\r\n## Notes \r\n- Currently, this insertion can insert in the wrong location if the sentence passed off to the NLPEngine contains a structured phrase (e.g. parsing `anything @age[[51]] grade 1` will insert a structured phrase for grade 1, but in the wrong location and simultaneously fail to delete `grade 1`). This is a known bug and is being tracked.\r\n\r\n- If the NLP processing takes a noticable amount of time, the phrase \"NLP Processing...\" appears in the upper-right hand of the breadcrumbs menu. \r\n\r\n- While making changes to FluxNotesEditor I also ended up breaking off the rendering of note description content into its own function, aptly names `renderNoteDescriptionContent`.\r\n\r\n- I also introduce a new function for inserting structured phrases that allow users to specify a range and insert there directly. The plain insertStructuredPhrase function still works, but calls this more specific function, passing the current editor selection as the range argument.\r\n\r\n- **N.B.** This PR does not remove #toxicity, it simply adds a second version of the toxicity shortcut that changes the same objects on the patient JSON, but stands independently from #toxicity in all other facets (e.g. autocomplete, contextOptions suggestions, etc...)\r\n\r\n- Note Parser has not been updated to interact with the NLPEngine. There is a JIRA to address this, and @gregquinn2001 has agreed with me to put this off until then.\r\n\r\n_Pull requests into Flux require the following. Submitter and reviewer should :white_check_mark: when done. For items that are not-applicable, note it's not-applicable (**N/A**) and :white_check_mark:._\r\n\r\n\r\n## Submitter:\r\n\r\n**Running the Application**\r\n\r\n- [x] Manually tested in Chrome\r\n- [x] Manually tested in IE\r\n\r\n**Documentation**\r\n\r\n- [x] This pull request describes why these changes were made\r\n- [x] Recognizes any potential shortcomings/bugs in the description \r\n- **N/A** Cheat sheet is updated\r\n- **N/A** Demo script is updated \r\n- **N/A** Documentation on Wiki has been updated \r\n- **N/A** Additional technical components and libraries are documented and added to wiki as needed\r\n\r\n**NoteParser**\r\n\r\n- **N/A** Note parser has been updated if structured phrases change\r\n\r\n**Code Quality**\r\n\r\n- [x] 4-space indents - convert any tabs to spaces\r\n- [x] Use public class field syntax for binding functions - ex. handleChange = () => { ... };\r\n- [x] Code is commented\r\n\r\n**Tests**\r\n\r\n- [x] Existing tests passed\r\n- **N/A** Added Enzyme-UI tests for slim mode \r\n- **N/A** Added Enzyme-UI tests for full mode\r\n- **N/A** Added backend tests for new functionality added\r\n- **N/A** Added note parser examples to test new functionality\r\n\r\n\r\n## Reviewer 1: Name\r\n\r\n- [ ] Code is maintainable and reusable, reuses existing code and infrastructure where appropriate, and accomplishes the task’s purpose\r\n- [ ] The tests appropriately test the new code, including edge cases\r\n- [ ] You have tried to break the code\r\n\r\n\r\n## Reviewer 2: Name\r\n\r\n- [ ] Code is maintainable and reusable, reuses existing code and infrastructure where appropriate, and accomplishes the task’s purpose\r\n- [ ] The tests appropriately test the new code, including edge cases\r\n- [ ] You have tried to break the code\r\n"},"comment":{"url":"https://api.github.com/repos/FluxNotes/flux/issues/comments/412118497","html_url":"https://github.com/FluxNotes/flux/pull/390#issuecomment-412118497","issue_url":"https://api.github.com/repos/FluxNotes/flux/issues/390","id":412118497,"node_id":"MDEyOklzc3VlQ29tbWVudDQxMjExODQ5Nw==","user":{"login":"jafeltra","id":30803904,"node_id":"MDQ6VXNlcjMwODAzOTA0","avatar_url":"https://avatars0.githubusercontent.com/u/30803904?v=4","gravatar_id":"","url":"https://api.github.com/users/jafeltra","html_url":"https://github.com/jafeltra","followers_url":"https://api.github.com/users/jafeltra/followers","following_url":"https://api.github.com/users/jafeltra/following{/other_user}","gists_url":"https://api.github.com/users/jafeltra/gists{/gist_id}","starred_url":"https://api.github.com/users/jafeltra/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jafeltra/subscriptions","organizations_url":"https://api.github.com/users/jafeltra/orgs","repos_url":"https://api.github.com/users/jafeltra/repos","events_url":"https://api.github.com/users/jafeltra/events{/privacy}","received_events_url":"https://api.github.com/users/jafeltra/received_events","type":"User","site_admin":false},"created_at":"2018-08-10T15:29:52Z","updated_at":"2018-08-10T15:29:52Z","author_association":"COLLABORATOR","body":"Checked this again after the rebase and it looks good! I'm going to merge it in!"}}
{"actor":{"display_login":"jafeltra"}}