Skip to content

Instantly share code, notes, and snippets.

@p2
Last active August 29, 2015 14:20
Show Gist options
  • Save p2/244029cbaca681dead59 to your computer and use it in GitHub Desktop.
Save p2/244029cbaca681dead59 to your computer and use it in GitHub Desktop.
Example FHIR MedicationPrescription codings

Example FHIR codings

Example MedicationStatement resources on how certain scenarios can be stated. Only the parts relevant to the dosage are shown, Patient and Medication references as well as dates should be present as well.


Medication is taken daily, not further specified when:

{
    "resourceType": "MedicationStatement",
    ...
    "status": "in-progress",
    "wasNotGiven": false,
    "dosage": [
        {
            "text": "TAKE 1 TABLET AT BEDTIME AS NEEDED FOR SLEEP",
            "schedule": {
                "repeat": {
                    "count": 1,
                    "frequency": 1,
                    "durationUnits": "d"
                }
            },
            "quantity": {
                "value": 1
            }
        }
    ]
}

Medication is taken daily, 2 with breakfast and 1 with dinner:

{
    "resourceType": "MedicationStatement",
    ...
    "status": "in-progress",
    "wasNotGiven": false,
    "dosage": [
        {
            "text": "TAKE 1 TABLET AT BEDTIME AS NEEDED FOR SLEEP",
            "schedule": {
                "repeat": {
                    "count": 1,
                    "when": "CM"
                }
            },
            "quantity": {
                "value": 2
            }
        },
        {
            "text": "TAKE 1 TABLET AT BEDTIME AS NEEDED FOR SLEEP",
            "schedule": {
                "repeat": {
                    "count": 1,
                    "when": "CV"
                }
            },
            "quantity": {
                "value": 1
            }
        }
    ]
}

Medication is taken on a schedule. note is present if the patient further specified.

FHIR allows quite extensive modeling of timing/schedule, but since we're only collecting an optional narrative for now I'm only submitting an almost empty Timing element with a custom code for dosage.schedule.

{
    "resourceType": "MedicationStatement",
    ...
    "status": "in-progress",
    "wasNotGiven": false,
    "note": "on a schedule",
    "dosage": [
        {
            "text": "INSTRUCTIONS FOR THIS MED",
            "schedule": {
                "code": {
                    "text": "schedule"
                }
            }
        }
    ]
}

Medication is taken as needed. note is present if the patient further specified.

{
    "resourceType": "MedicationStatement",
    ...
    "status": "in-progress",
    "wasNotGiven": false,
    "note": "Not that often",
    "dosage": [
        {
            "text": "TAKE 1 TABLET AT BEDTIME AS NEEDED FOR SLEEP",
            "asNeededBoolean": true
        }
    ]
}

Medication was not taken, not further specified:

{
    "resourceType": "MedicationStatement",
    ...
    "status": "completed",
    "wasNotGiven": true
}

Medication was not taken, never given:

{
    "resourceType": "MedicationStatement",
    ...
    "status": "entered-in-error",
    "wasNotGiven": true
}

Medication was not taken, never given and a reason text was entered by the user:

{
    "resourceType": "MedicationStatement",
    ...
    "status": "entered-in-error",
    "wasNotGiven": true,
    "note": "I did not know I was supposed to take this."
}

Patient stopped taking the pill and gives a reason:

{
    "resourceType": "MedicationStatement",
    ...
    "status": "completed",
    "wasNotGiven": true,
    "note": "Don't like the color"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment