Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

http://http://fhir.patientsknowbest.com/structuredefinition/aggregated-medicationstatement

https://www.hl7.org/fhir/R4/medicationstatement.html

Description

This profile is…

This profile is not…

  • a spec for all Medication and MedicationStatement resources returned from the Aggregated FHIR endpoint; resources sent to a Customer FHIR endpoint are not guaranteed to conform to this profile

  • a spec describing how Medication and MedicationStatement resources must be sent to a Customer FHIR endpoint; some of the elements used in this profile might only be meaningful for migrated data and cannot be provided to a Customer FHIR endpoint

Relevant PKB entities

FHIR

PKB

Notes

Resource id

[[Medication.Aggregated Data Point ID]]

Resource meta

...

...

...

...

...

...

Relevant PKB entities

FHIR

PKB

Notes

Resource id

[[Medication.Aggregated Data Point ID]]

Resource meta

meta: Meta

lastUpdated = time of most recent update, automatically maintained by the FHIR server. It is normal for this to be slightly later than any value returned in the
/structuredefinition/version-persisted extension.
    • <conditional>

    • If Source Person is a Professional:

    • security[x]: Coding

      • system =

 "
privacy
label"
 [[Data Point.Privacy Label]]
organization”
      • patient

      • code = the resource ID of the

Organization representing the [[Data Point.Source Organisation]]
source
team”
      • org

      • code = the resource ID of the Organization representing the [[Data Point.

Source Team
      • Connecting Organisation]]

  • <conditional>

  • If Source Person is a Professional:

  • security[x]: Coding

  • Else if Source Person is a Patient:

  • security[x]: Coding

    system

    [[Data Point.Privacy Label]] code mappings (PKB → FHIR):

    • GENERAL_HEALTH → GENERAL_HEALTH

    • MENTAL_HEALTH → MENTAL_HEALTH

    • SEXUAL_HEALTH → SEXUAL_HEALTH

    • SOCIAL_CARE → SOCIAL_CARE

    codesystem
    source-patient”
  • code = the resource ID of the Patient

  • Privacy Label
      • Uploaded Data ID]]

     code mappings (PKB → FHIR):
  • GENERAL_HEALTH → GENERAL_HEALTH

  • MENTAL_HEALTH → MENTAL_HEALTH

  • SEXUAL_HEALTH → SEXUAL_HEALTH

  • SOCIAL_CARE → SOCIAL_CARE

    A single uploadeddata entry can result in multiple data points, so this ID does not necessarily uniquely identify a data point.

    • extension[x]: Extension

      • url =

    "
    source-text"valueString
    Source Text
        • Access Route]]

    • extension[x]: Extension

      • url =

    responsible
    organization
      • text"

      • valueString = [[Data Point.

    Responsible Organisation Identifier
      • Source Text]]

    partner
    identifier

    identifier: Identifier

    value

    valueReference: Reference

      • valueString = [[Data Point.

    HL7 Partner]]system = http://fhir.patientsknowbest.com/id/public-id”
      • Responsible Organisation Identifier]]

    access
    route
    valueCoding
        • identifier:

    Codingcode
        • Identifier

          • system =

    http://fhir.patientsknowbest.com/codesystem/access-route
          • “urn:uuid:cd97da65-0aa4-43a6-b695-cfd0c6f3267d

          • value = [[Data Point.

    Access Route
          • HL7 Partner]]

    the source organisation of the privacy override
        • the source organisation of the most recent privacy override

    Note that this is a reference, unlike the meta.security which contains a code.

    Note that this is a reference, unlike the meta.security which contains a code.

    the privacy override
        • the most recent privacy override

    Note that this is a reference, unlike the meta.security which contains a code.

    entered

    • extension[x]: Extension

      • url = “

    http://fhir.patientsknowbest.com/structuredefinition/uploaded-data-id
  • valueString = [[Data Point.Uploaded Data ID]]

  • A single uploadeddata entry can result in multiple data points, so this ID does not necessarily uniquely identify a data point.

    MedicationStatement.extension

    For each [[Medication.Attachment]]:

    The “Resolve()” notation indicates that the display value for the corresponding specialty code will be determined at the time of retrieval, based on the (optional) code set for the source organisation.

    MedicationStatement.identifier

    • identifier[x]: Identifier

      • value = [[Data Point.External Data Point ID]]

      • assigner: Reference

        • reference = the relative URL of the Organization representing the [[Data Point.Source Organisation]]

    MedicationStatement.status

    "unknown"
    • <conditional>

    • If [[Medication.Status]]

    cannot be used here because there is not a clear semantic mapping from the PKB values to the FHIR values.
    • == INACTIVE:

      • “completed“

    • Else

      • “active“

    MedicationStatement.medicationCodeableConcept

    [[Medication.Substance]]

    MedicationStatement.effectivePeriod

    • effectivePeriod: Period

      • start = [[Medication.Start Timestamp]]

      • end = [[Medication.End Timestamp]]

    MedicationStatement.subject

    • subject: Reference

      • reference = the relative URL of the Patient resource

      • display = [[User.Title]] [[User.Given Name]] [[User.Family Name]]

    MedicationStatement.dosage

    • dosage[0]: Dosage

      • text = [[Medication.Frequency Text]]

      • patientInstruction = [[Medication.Instructions]]

      • timing: Timing

        • <conditional>

        • If [[Medication.Frequency Priority]] != AS_DIRECTED AND != AS_NEEDED:

          • repeat: Element

            • frequency = 1

            • period = [[Medication.Frequency Value]]

            • periodUnit = [[Medication.Frequency Units]]

        • Else if [[Medication.Frequency Priority]] == AS_DIRECTED:

          • code: CodeableConcept

            • text = "As directed"

        • Else:

          • Omit the "code" element

      • <conditional>

      • If [[Medication.Frequency Priority]] == AS_NEEDED:

        • asNeededBoolean = true

      • Else:

        • Omit the "asNeededBoolean" element

      • doseAndRate: Element

        • doseQuantity: SimpleQuantity

          • extension[x]: Extension

            • url =

    “http
    units”
            • units

            • valueCodeableConcept = [[Medication.Dose Units]]

          • value = [[Medication.Dose Value]]

          • <conditional>

          • If

    doseUnitPkbId
          • [[Medication.Medication Unit]] NOT NULL:

            • code = 

    corresponding MedicationUnit enum value (e.g. INJECTION)
            • [[Medication.Medication Unit]]

          • Else if

    doseUnit.displayText
          • [[Medication.Dose Units.Display Text]] NOT BLANK:

            • unit = [[Medication.Dose Units.Display Text]]

     {displayText}
          • Else:

            • unit = [[Medication.Dose Units]] {coding[0] - display}

            • system = [[Medication.Dose Units]] {coding[0] - system}

            • code = [[Medication.Dose Units]] {coding[0] - code}

    [[Medication.Frequency Units]] code mappings (PKB → FHIR):

    • HOUR → h

    Note #1: PKB supports more than one for dose units, but Quantity can represent only one. To ensure data is not lost, an extension is returned with the full CodeableConcept.

    Note #2: Frequency instructions of “as directed” are discouraged, but if they have been provided then “As directed” will be set into the timing.code.text element.