Skip to content

Instantly share code, notes, and snippets.

@jmandel jmandel/examples.md
Last active Sep 9, 2019

Embed
What would you like to do?
Realtime Benefits Check Examples

POST /$rx-pricing

Where can I fulfill my simvastatin prescription within two miles of 85054?

{
  "resourceType": "Parameters",
  "parameter": [{
    "name": "patient",
    "resource": {
      "resourceType": "Patient",
      "identifier": [{
        "system": "https://pbm.example.org/identifier",
        "value": "9817234912-XX1"
      }]
    }
  },{
    "name": "prescriber",
    "resource": {
      "resourceType": "Practitioner",
      "id": "123",
      "name": [{
        "given": ["Jeff"],
        "family": "Smith"
      }],
      "identifier": [{
        "system": "http://hl7.org/fhir/sid/us-npi",
        "value": "1234567890"
      }]
    }
  },{
    "name": "prescription",
    "resource": {
      "resourceType": "MedicationRequest",
      "id": "456",
      "status": "active",
      "intent": "order",
      "requester": {
        "reference": "Practitioner/123"
      },
      "medicationCodeableConcept": {
        "coding": [{
          "system": "http://hl7.org/fhir/sid/ndc",
          "code": "51079-456-20",
          "display": "Simvastatin 40mg tablet 100 blister pack"
        }]
      },
      "doseAndRate": [{
        "doseQuantity": {
          "value": 40,
          "unit": "mg",
          "system": "http://unitsofmeasure.org",
          "code": "mg"
        }
      }],
      "dispenseRequest": {
        "quantity": {
          "value": 100,
          "unit": "tablets",
          "system": "http://terminology.hl7.org/CodeSystem/v3-orderableDrugForm",
          "code": "TAB"
        },
        "expectedSupplyDuration": {
          "value": 100,
          "unit": "days",
          "system": "http://unitsofmeasure.org",
          "code": "d"
        }
      }
    }
  },{
    "name": "preferred-location",
    "valueAddress": {
      "postalCode": "85054"
    }
  },{
    "name": "preferred-location-radius-miles",
    "valueDecimal": 2
  }]
}

Response

Here are two pharmacies -- a nearby CVS ($15) and a slightly farther Walmart ($10)

{
  "resourceType": "Parameters",
  "parameter": [{
    "name": "fulfillment-option",
    "part": [{
      "name": "modified",
      "valueBoolean": false,
    },{
      "name": "distance-in-miles",
      "valueDecimal": 1,
    },{
      "name": "prescription",
      "resource": {
        "resourceType": "MedicationOrder", // might be same as in request, or any alterations...
      }
    },{
      "name": "location",
      "valueAddress": {
        "line": ["CVS Pharmacy", "6045 N Scottsdale Road"],
        "city": "Scottsdale",
        "state": "AZ",
        "postalCode": "85250"
      }
    },{
      "name": "price",
      "valueMoney": {
        "value": 15,
        "currency": "USD"
      }
    }]
  },{
    "name": "fulfillment-option",
    "part": [{
      "name": "modified",
      "valueBoolean": false,
    },{
      "name": "distance-in-miles"
      "valueDecimal": 2,
    },{
      "name": "prescription",
      "resource": {
        "resourceType": "MedicationOrder", // might be same as in request, or any alterations...
      }
    },{
      "name": "location",
      "valueAddress": {
        "line": ["Walmart Supercenter", "4915 N Pima Rd"],
        "city": "Scottsdale",
        "state": "AZ",
        "postalCode": "85251"
      }
    },{
      "name": "price",
      "valueMoney": {
        "value": 10,
        "currency": "USD"
      }
    }]
  }]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.