Starfish API Documentation

Replacing Contact Lens Prescriptions

Replacing contact lens prescriptions creates a new prescription in a draft state. For guidance on creating a prescription, please refer to the API documentation available here. The provided variables should include the public ID of the prescription the user would like to replace under the new prescriptionToReplaceId field.

{
  ...
  "prescribingLocationId": "Location-9R3TMR8XMV4",
  "prescriptionToReplaceId": "ContactLensPrescription-PBWINNXQG4M",
  "createdById": "StaffMember-WVNFD3KPVRD"
  ...
}

1. Get the confirmation URL

Once the request is submitted to our API to create a new prescription including the prescriptionToReplaceId field, the API responds with a confirmation URL.

Query

mutation ($input: CreateContactLensPrescriptionMutationInput!) {
  createContactLensPrescription(input: $input) {
    confirmReplacementUrl
  }
}

Variables

{
  "input": {
    "userId": "AccountHolder-XL3FBMGL86",
    "validityPeriod": {
      "startDate": "2021-05-19",
      "expiryDate": "2023-05-19"
    },
    "patient": {
      "firstName": "Bob",
      "lastName": "Carpe",
      "dateOfBirth": "1980-02-02",
      "personalIdentityNumber": "19920801-1234"
    },
    "leftEye": {
      "productId": "Product-6DPSXO6DEDY",
      "properties": [
        {
          "name": "power",
          "value": "+1.00"
        },
        {
          "name": "bc",
          "value": "9.0"
        },
        {
          "name": "dia",
          "value": "14.2"
        }
      ]
    },
    "doctor": {
      "doctorsName": "Gerald Fields",
      "phoneNumber": "01234",
      "locationName": "Dr Hype",
      "addressLine1": "Humphries Rd",
      "city": "Utah City",
      "countryCode": "US",
      "postalCode": "84101",
      "region": "UT",
      "isThirdPartyLocation": true
    },
    "prescribingLocationId": "Location-9R3TMR8XMV4",
    "prescriptionToReplaceId": "ContactLensPrescription-LQ9I6PP2M8K",
    "createdById": "StaffMember-WVNFD3KPVRD"
  }
}

Response

{
  "data": {
    "createContactLensPrescription": {
      "confirmReplacementUrl": "http://acme.platform.localhost:3000/en-US/contact-lens-prescriptions/LQ9I6PP2M8K/replacements/XD2IP77V26N/edit"
    }
  }
}

2. Navigate to the confirmation page

The PMS user navigates to the provided URL, which directs them to a confirmation page within the Starfish app. The confirmation page displays the old prescription alongside the new one.

3. Cancel or approve the replacement

The PMS user has the option to either cancel or approve the replacement displayed on the confirmation page.

If the old prescription includes a subscription, once the staff user verifies the validity of the new prescription, they are directed to the existing subscription approval page. There, they can confirm their satisfaction with the new payments.

If the old prescription does not include a subscription, the process concludes with the staff user verifying the validity of the new prescription.

Once all details are confirmed, the status of the new prescription changes from draft to approved replacing the original prescription.