Compare commits
1 Commits
d3f5790076
...
1935ecc345
| Author | SHA1 | Date | |
|---|---|---|---|
| 1935ecc345 |
|
|
@ -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],
|
||||
['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],
|
||||
['vomiting', /\b(?:vomit(?:ing|ed|s)?|throw(?:ing|s)? up|threw up|thrown up|puk(?:e|ed|ing|es)|emesis)\b/i],
|
||||
['vomiting', /\b(?:vomit(?:ing|ed|s)?|throw(?:ing|s)? up|threw up|thrown up)\b/i],
|
||||
['fever', /\bfever(?:ish)?\b/i],
|
||||
['cannotPassGas', /\b(?:cannot|can['’]?t|cant|unable to|not able to) pass gas\b/i],
|
||||
]);
|
||||
|
|
|
|||
|
|
@ -51,8 +51,6 @@ test('detects common urgent symptom language without matching unrelated blood wo
|
|||
'I have severe stomach pain',
|
||||
'I am throwing up and have a fever',
|
||||
'I threw up',
|
||||
'I puked twice',
|
||||
'I have emesis',
|
||||
'I am unable to pass gas',
|
||||
]) assert.equal(detectUrgentText(message).urgent, true, message);
|
||||
assert.equal(detectUrgentText('My blood pressure was checked').urgent, false);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user