Compare commits
1 Commits
1935ecc345
...
d3f5790076
| Author | SHA1 | Date | |
|---|---|---|---|
| d3f5790076 |
|
|
@ -4,7 +4,7 @@ const URGENT_TEXT_PATTERNS = Object.freeze([
|
||||||
['blood', /\b(?:rectal bleeding|bleeding from (?:the )?(?:rectum|bottom)|blood(?:y)? (?:in|on|with) (?:my |the )?(?:stool|poop|bowel movement)|(?:stool|poop) (?:has|contains|with) blood)\b/i],
|
['blood', /\b(?:rectal bleeding|bleeding from (?:the )?(?:rectum|bottom)|blood(?:y)? (?:in|on|with) (?:my |the )?(?:stool|poop|bowel movement)|(?:stool|poop) (?:has|contains|with) blood)\b/i],
|
||||||
['blackOrDarkRed', /\b(?:(?:black|dark[- ]?red) (?:stool|poop|bowel movement)|(?:stool|poop|bowel movement) (?:is|looks?) (?:black|dark[- ]?red))s?\b/i],
|
['blackOrDarkRed', /\b(?:(?:black|dark[- ]?red) (?:stool|poop|bowel movement)|(?:stool|poop|bowel movement) (?:is|looks?) (?:black|dark[- ]?red))s?\b/i],
|
||||||
['severePain', /\b(?:severe|constant|unrelenting) (?:abdominal|stomach|belly) pain\b/i],
|
['severePain', /\b(?:severe|constant|unrelenting) (?:abdominal|stomach|belly) pain\b/i],
|
||||||
['vomiting', /\b(?:vomit(?:ing|ed|s)?|throw(?:ing|s)? up|threw up|thrown up)\b/i],
|
['vomiting', /\b(?:vomit(?:ing|ed|s)?|throw(?:ing|s)? up|threw up|thrown up|puk(?:e|ed|ing|es)|emesis)\b/i],
|
||||||
['fever', /\bfever(?:ish)?\b/i],
|
['fever', /\bfever(?:ish)?\b/i],
|
||||||
['cannotPassGas', /\b(?:cannot|can['’]?t|cant|unable to|not able to) pass gas\b/i],
|
['cannotPassGas', /\b(?:cannot|can['’]?t|cant|unable to|not able to) pass gas\b/i],
|
||||||
]);
|
]);
|
||||||
|
|
|
||||||
|
|
@ -51,6 +51,8 @@ test('detects common urgent symptom language without matching unrelated blood wo
|
||||||
'I have severe stomach pain',
|
'I have severe stomach pain',
|
||||||
'I am throwing up and have a fever',
|
'I am throwing up and have a fever',
|
||||||
'I threw up',
|
'I threw up',
|
||||||
|
'I puked twice',
|
||||||
|
'I have emesis',
|
||||||
'I am unable to pass gas',
|
'I am unable to pass gas',
|
||||||
]) assert.equal(detectUrgentText(message).urgent, true, message);
|
]) assert.equal(detectUrgentText(message).urgent, true, message);
|
||||||
assert.equal(detectUrgentText('My blood pressure was checked').urgent, false);
|
assert.equal(detectUrgentText('My blood pressure was checked').urgent, false);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user