Starfish API Documentation

Importing Contact Lens Prescriptions

Importing contact lens prescriptions requires both the customer and member of staff to have an account in Starfish. Staff accounts must be added through the Starfish application, but customer accounts can be created via the API. We also require information about the product and the prescribing location. The steps below walk through fetching all the required data before importing the contact lens prescription.

1. Fetch the staff member from Starfish

Query the staffMember endpoint to get the staff member's Starfish ID. We can use this ID when the member of staff imports contact lens prescriptions via the API.

Query

query($externalStaffUserIdentifier: String) {
  staffMember(externalStaffUserIdentifier: $externalStaffUserIdentifier) {
    id
  }
}

Variables

{
  "externalStaffUserIdentifier": "pms-claudia"
}

Response

{
  "data": {
    "staffMember": {
      "id": "StaffMember-WVNFD3KPVRD"
    }
  }
}

2. Fetch the customer from Starfish

If there is not already an account holder for this customer, follow the documentation here to create one.

Query the AccountHolder endpoint to get the customer's Starfish ID. We'll pass this up in the request when importing the customer's prescription.

Query

query SearchAccountHolders($pmsPatientIdentifier: StringQueryInput) {
  accountHolders(pmsPatientIdentifier: $pmsPatientIdentifier) {
    nodes {
      id
      pmsPatientIdentifier
    }
  }
}

Variables

{
  "pmsPatientIdentifier": {
    "is": "123456"
  }
}

Response

{
  "data": {
    "accountHolders": {
      "nodes": [
        {
          "id": "AccountHolder-MZVF2MBN8GR",
          "pmsPatientIdentifier": "123456"
        }
      ]
    }
  }
}

3. Fetch the product from Starfish

If we don't have the ID for the product, we can fetch that from the API.

Query

query SearchProducts {
  products(name: {contains: "Acuvue"}) {
    nodes {
      id
      name
      description
    }
  }
}

Variables

null

Response

{
  "data": {
    "products": {
      "nodes": [
        {
          "id": "Product-6DPSXO6DEDY",
          "name": "1-Day Acuvue Moist 30 pack",
          "description": "  <ul>\n      <li>Keeps moisture in and irritation out.</li>\n      <li>Available with correction for short and long-sighted prescriptions.</li>\n      <li>Class 2 UV protection‡ for peace of mind</li>\n      <li>Lacreon ® technology provides a long-lasting cushion of moisture for exceptional comfort**</li>\n</ul>\n"
        },
        {
          "id": "Product-DKWSLJ9VW36",
          "name": "1-Day Acuvue Moist 90 pack",
          "description": "  <ul>\n      <li>Keeps moisture in and irritation out.</li>\n      <li>Available with correction for short and long-sighted prescriptions.</li>\n      <li>Class 2 UV protection‡ for peace of mind</li>\n      <li>Lacreon ® technology provides a long-lasting cushion of moisture for exceptional comfort**</li>\n</ul>\n"
        },
        {
          "id": "Product-ROESYOQZWY6",
          "name": "ACUVUE OASYS 6 Pack",
          "description": "  <p>ACUVUE OASYS® delivers exceptional comfort and performance in challenging environments, such as digital devices, A/C or dusty, dry air.</p>\n"
        }
      ]
    }
  }
}

4. Fetch the location from Starfish

If the prescription is an in-house prescription, you can pass this ID up when importing the customer's prescription. If you don't have this location's Starfish ID, you can fetch it from the API:

Query

query SearchLocations($name: StringQueryInput) {
  locations(name: $name) {
    nodes {
      id
      name
      city
      countryCode
    }
  }
}

Variables

{
  "name": {
    "contains": "James "
  }
}

Response

{
  "data": {
    "locations": {
      "nodes": [
        {
          "id": "Location-G9LT2699KD6",
          "name": "James Road",
          "city": "New York",
          "countryCode": "US"
        }
      ]
    }
  }
}

5. Import the contact lens prescription

Now we have the user's ID, the staff member's ID, the product ID, and the location ID, we can import the prescription via the API following the documentation here.