HiMS API Documentation

HIMS FHIR documentation version 1.0


MedicationRequest

GET https://fhir-api.hmsfirst.com/r4/MedicationRequest

The Medication Request resource covers medication orders for a patient. This includes both inpatient and outpatient orders related to medications. This is not intended for diet prescriptions or for non-medication items (such as sunglasses, supplies, etc.)

The Medication Request resource returns data classes and elements defined for Medications in United States Core Data for Interoperability (USCDI v2). Example API requests for Medication request records are shown below:

Retrieve all medication requests related to a patient


curl --request GET \
--url 'https://fhir-api.hmsfirst.com/r4/MedicationRequest?patient={patientId}' \
--header 'Accept: application/fhir+json' \
--header 'Authorization: Bearer ACCESS_TOKEN'

Examples:
GET https://fhir-api.hmsfirst.com/r4/MedicationRequest?patient=29355
                    

Find medications related to a patient based on the date/time that the order was initially created


curl --request GET \
--url 'https://fhir-api.hmsfirst.com/r4/MedicationRequest?patient={patientId}&authoredon={date}' \
--header 'Accept: application/fhir+json' \
--header 'Authorization: Bearer ACCESS_TOKEN'

Example: (search on specific date)
GET https://fhir-api.hmsfirst.com/r4/MedicationRequest?patient=29355&authoredon=2019-01-01

Example: (search in date range)
GET https://fhir-api.hmsfirst.com/r4/MedicationRequest?patient=29355&authoredon=ge2019-01-01T00:00:00Z&authoredon=lt2020-01-01T00:00:00Z
                    

Response schema


{
  "type": "object",
  "required": [],
  "properties": {
    "resourceType": {
      "type": "string"
    },
    "id": {
      "type": "string"
    },
    "type": {
      "type": "string"
    },
    "total": {
      "type": "number"
    },
    "link": {
      "type": "array",
      "items": {
        "type": "object",
        "required": [],
        "properties": {
          "relation": {
            "type": "string"
          },
          "url": {
            "type": "string"
          }
        }
      }
    },
    "entry": {
      "type": "array",
      "items": {
        "type": "object",
        "required": [],
        "properties": {
          "fullUrl": {
            "type": "string"
          },
          "resource": {
            "type": "object",
            "required": [],
            "properties": {
              "resourceType": {
                "type": "string"
              },
              "id": {
                "type": "string"
              },
              "meta": {
                "type": "object",
                "required": [],
                "properties": {
                  "versionId": {
                    "type": "string"
                  },
                  "lastUpdated": {
                    "type": "string"
                  },
                  "profile": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  }
                }
              },
              "status": {
                "type": "string"
              },
              "intent": {
                "type": "string"
              },
              "category": {
                "type": "array",
                "items": {
                  "type": "object",
                  "required": [],
                  "properties": {
                    "coding": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [],
                        "properties": {
                          "system": {
                            "type": "string"
                          },
                          "code": {
                            "type": "string"
                          },
                          "display": {
                            "type": "string"
                          }
                        }
                      }
                    },
                    "text": {
                      "type": "string"
                    }
                  }
                }
              },
              "reportedBoolean": {
                "type": "string"
              },
              "medicationCodeableConcept": {
                "type": "object",
                "required": [],
                "properties": {
                  "coding": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "required": [],
                      "properties": {
                        "system": {
                          "type": "string"
                        },
                        "code": {
                          "type": "string"
                        },
                        "display": {
                          "type": "string"
                        }
                      }
                    }
                  },
                  "text": {
                    "type": "string"
                  }
                }
              },
              "subject": {
                "type": "object",
                "required": [],
                "properties": {
                  "reference": {
                    "type": "string"
                  }
                }
              },
              "encounter": {
                "type": "object",
                "required": [],
                "properties": {
                  "reference": {
                    "type": "string"
                  }
                }
              },
              "authoredOn": {
                "type": "string"
              },
              "requester": {
                "type": "object",
                "required": [],
                "properties": {
                  "reference": {
                    "type": "string"
                  },
                  "display": {
                    "type": "string"
                  }
                }
              },
              "dosageInstruction": {
                "type": "array",
                "items": {
                  "type": "object",
                  "required": [],
                  "properties": {
                    "sequence": {
                      "type": "number"
                    },
                    "text": {
                      "type": "string"
                    },
                    "asNeededBoolean": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}