Skip to content

Commit 2282752

Browse files
author
Legrand
committedMar 20, 2023
Remove docs, update README
1 parent a771271 commit 2282752

File tree

5 files changed

+207
-54
lines changed

5 files changed

+207
-54
lines changed
 

‎README.md

Lines changed: 207 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,3 +218,210 @@ Review - lets you review previously parsed sigs and mark them as correct or inco
218218
Demo - lets you enter individual free text sigs and shows the parsed response.
219219

220220
Sometimes a malformed parsed sig will prevent the Review page from loading. If this happens, either remove the sig from the database in MySQL phpMyadmin or enter 10 new sigs in the Demo page to clear it out.
221+
222+
## API documentation
223+
224+
### Request authentication
225+
226+
All requests must have an API key.
227+
228+
Create your own API key at http://localhost:8000/admin
229+
230+
**To authenticate:**
231+
232+
Headers of your request must include:
233+
234+
```
235+
Authorization: Api-Key <your API key here>
236+
Content-Type: application/json
237+
```
238+
239+
Invalid API keys will result in an HTTP 401, Unauthorized error.
240+
241+
### API resources
242+
243+
The ParseRx API expects HTTP URL request parameters and returns JSON responses. All requests must include your API key.
244+
245+
**Request**
246+
247+
`POST /sig/` = Generate / return a parsed sig and information on review status.
248+
249+
URL = http://localhost:8000/sig/
250+
251+
Format = JSON
252+
253+
Body
254+
255+
- `sig_text` (REQUIRED) string - your sig text here
256+
- `ndc` (optional) numeric ndc11 string - if you want to infer sig elements by ndc
257+
- `rxcui` (optional) numeric rxcui string - if you want to infer sig elements by rxcui
258+
259+
Example:
260+
261+
```
262+
{
263+
"sig_text": "tk 1-2 tab po qid x10d prn pain",
264+
"ndc": "12345678911",
265+
"rxcui": "123456"
266+
}
267+
```
268+
269+
NOTE: Depending on whether you submit a sig that ParseRx has parsed before, you will receive two different server responses.
270+
271+
- HTTP 200, OK - ParseRx has parsed this sig before, so it is just returning that previously parsed sig from the database.
272+
- HTTP 201, Created - ParseRx has not parsed this sig before, so it is dynamically parsing it, saving it to the database, and returning the result.
273+
274+
**Response**
275+
276+
`sig_text`
277+
278+
A string containing the modified sig_text from the request, converted to lower case, extraneous characters removed, and duplicate spaces converted to single spaces.
279+
280+
`sig_parsed`
281+
282+
A JSON object containing all the parsed components of the free text sig. See details of each component below.
283+
284+
`sig_inferred`
285+
286+
A JSON object containing all the inferred sig components if the request included an ndc or rxcui parameter. See details of each component below.
287+
288+
This entire object will only appear if a valid ndc or rxcui are included as a request parameter. If both are included, ndc will take precedence over rxcui.
289+
290+
`original_sig_text`
291+
292+
A string containing the original, un-modified sig_text from the request.
293+
294+
**Parsed sig components**
295+
296+
`method`
297+
298+
How the medication is administered (i.e. take, inject, inhale).
299+
300+
`dose`
301+
302+
`dose_max`
303+
304+
`dose_unit`
305+
306+
How much medication patient is instructed to take based on dosage (i.e. 2 tablets, 30 units, 1-2 puffs).
307+
308+
Numbers represented as words in the sig will be converted to integers (i.e. “one” will be converted to 1).
309+
310+
`strength`
311+
312+
`strength_max`
313+
314+
`strength_unit`
315+
316+
How much medication the patient is instructed to take based on strength (i.e. 500 mg, 15 mL, 17 g).
317+
318+
NOTE: ParseRx intentionally does not parse multiple ingredient strengths (i.e. if 5/325 mg is in a sig, it will return null for strength).
319+
320+
`route`
321+
322+
Route of administration of the medication (i.e. by mouth, via inhalation, in left eye).
323+
324+
`frequency`
325+
326+
`frequency_max`
327+
328+
`period`
329+
330+
`period_max`
331+
332+
`period_unit`
333+
334+
`time_duration`
335+
336+
`time_duration_unit`
337+
338+
`day_of_week`
339+
340+
`time_of_day`
341+
342+
`when`
343+
344+
`offset`
345+
346+
`bounds`
347+
348+
`count`
349+
350+
`frequency_readable`
351+
352+
How often medication should be administered (i.e. every 4-6 hours, three times daily, once daily in the morning with meal).
353+
354+
Due to the complexity and variety of medication instructions, these elements are based off of an existing standard - FHIR Timing.
355+
356+
For convenience, a frequency_readable is generated to represent a human-readable representation of the sig frequency.
357+
358+
`duration`
359+
360+
`duration_max`
361+
362+
`duration_unit`
363+
364+
How long the patient is instructed to take the medication (i.e. for 7 days, for 7-10 days, for 28 days).
365+
366+
NOTE: this is different from days’ supply, which represents how long a given supply of medication should last.
367+
368+
`as_needed`
369+
370+
`indication`
371+
372+
Whether the medication should be taken “as needed” (i.e. PRN), and the specific reason the patient is taking the medication (i.e. for pain, for wheezing and shortness of breath, for insomnia).
373+
374+
NOTE: indication may be populated even if as_needed is false. There are chronic indications represented in sigs as well (i.e. for cholesterol, for high blood pressure, for diabetes).
375+
376+
`sig_reviewed_status`
377+
378+
This is an indicator that a pharmacist / pharmacy resident has reviewed the sig.
379+
380+
Depending on the review status of the sig, it will return either unreviewed, correct, incorrect, or unknown.
381+
382+
`sig_reviewed`
383+
384+
If sig_reviewed_status is unreviewed or unknown, this will be null.
385+
Otherwise, this will return an object containing the reviewed components of the parsed sig. See details of each component below.
386+
387+
NOTE: ParseRx will be constantly improving, and as such, there may be multiple different versions of parsing a given sig. Each of these parsing versions will be reviewed by a pharmacist or pharmacy resident in time. If there exists a version that has a sig_reviewed_status of correct, this is the version that will be returned. Otherwise, the most recently parsed version of the sig will be returned.
388+
389+
IMPORTANT: Pay close attention to the sig_reviewed_status and sig_reviewed object. It is your responsibility to use this information safely.
390+
391+
**Reviewed sig components**
392+
393+
`sig_correct`
394+
395+
Whether the sig is considered to be parsed correctly overall or not.
396+
397+
`method_status`
398+
399+
`dose_status`
400+
401+
`strength_status`
402+
403+
`route_status`
404+
405+
`frequency_status`
406+
407+
`duration_status`
408+
409+
`indication_status`
410+
411+
If the sig is not considered to be parsed correctly overall, there may be values in these fields representing what the specific issue(s) are.
412+
413+
- 0 = incorrect - ParseRx returned something for this component, but it was not correct
414+
- 1 = missing - ParseRx did not return anything for this component, when it should have
415+
- 2 = optimize - ParseRx returned something for this component, but it could be improved
416+
417+
**Inferred sig components**
418+
419+
`method`
420+
421+
`dose_unit`
422+
423+
`route`
424+
425+
This entire object will only appear if a valid ndc or rxcui are included as a request parameter. If both are included, ndc will take precedence over rxcui.
426+
427+
Any or all of the inferred sig components may be null if it is not possible to infer them.

‎docs/0c7e37842e4bda6d90c771eaa874c3e8.svg

Lines changed: 0 additions & 1 deletion
This file was deleted.

‎docs/favicon.ico

-15 KB
Binary file not shown.

‎docs/index.html

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)