Difference between revisions of "Internal Medication API Subsystem"

From GrandCare Systems
Jump to navigation Jump to search
Line 1: Line 1:


The Medication subsystem allows you to create, view, edit and delete medications from a system via [[GCAPI]].
The Medication subsystem allows you to manage medications and medication schedules from a system via [[GCAPI]].
= Operations =
= Operations =
== createPrescription ==
== createPrescription ==
Line 30: Line 30:
=== Results ===
=== Results ===
SUCCESS, returns back saved medication
SUCCESS, returns back saved medication
==== json ====
$ curl "http://10.100.1.2/api/medication.php?op=createPresription&encoding=json&passcode=x&ingredient=Levothyroxin+Sodium&type=TABLET&dosage=100+ug/1&brandName=Synthroid&ndc=0074-3727-13&how=ORAL&quantity=100+TABLET+in+1+BOTTLE"
{
    "gcapi": {
        "result": "SUCCESS",
        "prescription": {
            "prescriptionId": "2",
            "deviceId": "0",
            "residentId": "0",
            "ingredient": "Levothyroxine Sodium",
            "brandName": "Synthroid",
            "simpleName": "Synthroid",
            "ndc": "0074-3727-13",
            "manufacturer": "",
            "type": "TABLET",
            "dosage": "100 ug/1",
            "description": "",
            "pillLabelSide1": "",
            "pillLabelSide2": "",
            "how": "ORAL",
            "instructionDetail1": "",
            "instructionDetail2": "",
            "instructionDetail3": "",
            "why": "",
            "doctor": "",
            "pharmacy": "",
            "rxnumber": "",
            "fillDate": "1970-01-01",
            "useBeforeDate": "1970-01-01",
            "quantity": "100 TABLET in 1 BOTTLE",
            "deleted": "0",
            "prescriptionImage": "/icon/meds.png"
        }
    }
}
== read ==
Reads a single medication or all medications
=== Parameters ===
* ''id'' - [optional] - ID of specific medication to read. If left blank, reads all medications
=== Results ===
Returns SUCCESS and a single medication or all medications in the following format:
==== xml ====
==== xml ====
$ curl "http://10.100.1.2/api/medication.php?op=create&encoding=xml&passcode=x&firstname=Nicholas&lastname=Hall&address=123+Fake+St&state=WI&zipcode=53095&city=West+Bend"
  <gcapi>
  <gcapi>
   <result>SUCCESS</result>
   <result>SUCCESS</result>
   <medication>
   <medication>
     <id>cbaaf355-9c16-4a24-858b-869f6bf303f9</id>
     <id>5f3e081d-e6af-4dd6-a6b8-dd4d8890e611</id>
     <firstname>Nicholas</firstname>
     <firstname>Shirley</firstname>
     <lastname>Hall</lastname>
     <lastname>Doe</lastname>
     <address>123 Fake St</address>
     <address>2412 West Washington Ave</address>
     <city>West Bend</city>
     <city>West Bend</city>
     <state>WI</state>
     <state>WI</state>
     <zipcode>53095</zipcode>
     <zipcode>53095</zipcode>
     <homephone> </homephone>
     <homephone>2623349394</homephone>
     <workphone> </workphone>
     <workphone>2623386147</workphone>
     <cellphone> </cellphone>
     <cellphone>2626896732</cellphone>
     <pager> </pager>
     <pager></pager>
     <email> </email>
     <email>shirley@grandcare.com</email>
   </medication>
   </medication>
  </gcapi>
  </gcapi>


==== json ====
==== json ====
$ curl "http://10.100.1.2/api/medication.php?op=create&encoding=json&passcode=x&firstname=Nicholas&lastname=Hall&address=123+Fake+St&state=WI&zipcode=53095&city=West+Bend"
  {
  {
     "gcapi": {
     "gcapi": {
         "result": "SUCCESS",
         "result": "SUCCESS",
         "medication": {
         "medication": [
            "id": "93c2dc15-20b3-4884-81ca-6f57335a1bdb",
            {
            "firstname": "Nicholas",
                "id": "5f3e081d-e6af-4dd6-a6b8-dd4d8890e611",
            "lastname": "Hall",
                "firstname": "Shirley",
            "address": "123 Fake St",
                "lastname": "Doe",
            "city": "West Bend",
                "address": "2412 West Washington Ave",
            "state": "WI",
                "city": "West Bend",
            "zipcode": "53095",
                "state": "WI",
            "homephone": " ",
                "zipcode": "53095",
            "workphone": " ",
                "homephone": "2623349394",
            "cellphone": " ",
                "workphone": "2623386147",
            "pager": " ",
                "cellphone": "2626896732",
            "email": " "
                "pager": "",
         }
                "email": "shirley@grandcare.com"
            }
         ]
     }
     }
  }
  }
== update ==
Updates an existing medication
=== Parameters ===
* ''id'' - [required] - ID of medication to update
* ''firstname'' - [optional] - First name
* ''lastname'' - [optional] - Last name
* ''email'' - [optional] - Email address
* ''address'' - [optional] - Street address
* ''city'' - [optional] - City
* ''state'' - [optional] - State
* ''zip'' - [optional] - Zip code
* ''homephone'' - [optional] - Home phone number
* ''workphone'' - [optional] - Work phone number
* ''cellphone'' - [optional] - Cell phone number
* ''pager'' - [optional] - Pager phone number
=== Results ===
Returns SUCCESS and a copy of the newly updated medication if successful, otherwise FAILURE. See the [[#read]] method for more information on the returned medication object.
== delete ==
Deletes an existing medication
=== Parameters ===
* ''id'' - [required] - ID of medication to delete
=== Results ===
Returns SUCCESS if the medication is deleted, otherwise FAILURE.


== RxLookup ==
== RxLookup ==
Line 237: Line 306:
     }
     }
  }
  }
== read ==
Reads a single medication or all medications
=== Parameters ===
* ''id'' - [optional] - ID of specific medication to read. If left blank, reads all medications
=== Results ===
Returns SUCCESS and a single medication or all medications in the following format:
==== xml ====
<gcapi>
  <result>SUCCESS</result>
  <medication>
    <id>5f3e081d-e6af-4dd6-a6b8-dd4d8890e611</id>
    <firstname>Shirley</firstname>
    <lastname>Doe</lastname>
    <address>2412 West Washington Ave</address>
    <city>West Bend</city>
    <state>WI</state>
    <zipcode>53095</zipcode>
    <homephone>2623349394</homephone>
    <workphone>2623386147</workphone>
    <cellphone>2626896732</cellphone>
    <pager></pager>
    <email>shirley@grandcare.com</email>
  </medication>
</gcapi>
==== json ====
{
    "gcapi": {
        "result": "SUCCESS",
        "medication": [
            {
                "id": "5f3e081d-e6af-4dd6-a6b8-dd4d8890e611",
                "firstname": "Shirley",
                "lastname": "Doe",
                "address": "2412 West Washington Ave",
                "city": "West Bend",
                "state": "WI",
                "zipcode": "53095",
                "homephone": "2623349394",
                "workphone": "2623386147",
                "cellphone": "2626896732",
                "pager": "",
                "email": "shirley@grandcare.com"
            }
        ]
    }
}
== update ==
Updates an existing medication
=== Parameters ===
* ''id'' - [required] - ID of medication to update
* ''firstname'' - [optional] - First name
* ''lastname'' - [optional] - Last name
* ''email'' - [optional] - Email address
* ''address'' - [optional] - Street address
* ''city'' - [optional] - City
* ''state'' - [optional] - State
* ''zip'' - [optional] - Zip code
* ''homephone'' - [optional] - Home phone number
* ''workphone'' - [optional] - Work phone number
* ''cellphone'' - [optional] - Cell phone number
* ''pager'' - [optional] - Pager phone number
=== Results ===
Returns SUCCESS and a copy of the newly updated medication if successful, otherwise FAILURE. See the [[#read]] method for more information on the returned medication object.
== delete ==
Deletes an existing medication
=== Parameters ===
* ''id'' - [required] - ID of medication to delete
=== Results ===
Returns SUCCESS if the medication is deleted, otherwise FAILURE.

Revision as of 17:30, 27 August 2012

The Medication subsystem allows you to manage medications and medication schedules from a system via GCAPI.

Operations

createPrescription

Create a new prescription

Parameters

  • ingredient - [required] - Ingredient (Chemical name)
  • type - [required] - Type (pill, liquid, injection, etc)
  • dosage - [required] - Single dosage
  • deviceId - [optional] - Medication device tied to prescription, default ANY
  • brandName - [optional] - Proprietary Name
  • simpleName - [optional] - Display name, default brandName
  • ndc - [optional] - FDA's NDC code
  • manufacturer - [optional] - Medication labeler
  • description - [optional] - Medication description
  • pillLabelSide1 - [optional]
  • pillLabelSide2 - [optional]
  • how - [optional] - Usage instructions
  • instructionDetail1 - [optional]
  • instructionDetail2 - [optional]
  • instructionDetail3 - [optional]
  • why - [optional] - Symptoms treated
  • doctor - [optional] - Prescribing doctor
  • pharmary - [optional] - Prescription Pharmacy
  • rxnumer - [optional] - Proprietary Rx number
  • fillDate - [optional] - Date filled
  • useBeforeDate - [optional] - Expiry date
  • quantity - [optional] - Total in prescription, default 0

Results

SUCCESS, returns back saved medication

json

$ curl "http://10.100.1.2/api/medication.php?op=createPresription&encoding=json&passcode=x&ingredient=Levothyroxin+Sodium&type=TABLET&dosage=100+ug/1&brandName=Synthroid&ndc=0074-3727-13&how=ORAL&quantity=100+TABLET+in+1+BOTTLE"
{
   "gcapi": {
       "result": "SUCCESS",
       "prescription": {
           "prescriptionId": "2",
           "deviceId": "0",
           "residentId": "0",
           "ingredient": "Levothyroxine Sodium",
           "brandName": "Synthroid",
           "simpleName": "Synthroid",
           "ndc": "0074-3727-13",
           "manufacturer": "",
           "type": "TABLET",
           "dosage": "100 ug/1",
           "description": "",
           "pillLabelSide1": "",
           "pillLabelSide2": "",
           "how": "ORAL",
           "instructionDetail1": "",
           "instructionDetail2": "",
           "instructionDetail3": "",
           "why": "",
           "doctor": "",
           "pharmacy": "",
           "rxnumber": "",
           "fillDate": "1970-01-01",
           "useBeforeDate": "1970-01-01",
           "quantity": "100 TABLET in 1 BOTTLE",
           "deleted": "0",
           "prescriptionImage": "/icon/meds.png"
       }
   }
}

read

Reads a single medication or all medications

Parameters

  • id - [optional] - ID of specific medication to read. If left blank, reads all medications

Results

Returns SUCCESS and a single medication or all medications in the following format:

xml

<gcapi>
 <result>SUCCESS</result>
 <medication>
   <id>5f3e081d-e6af-4dd6-a6b8-dd4d8890e611</id>
   <firstname>Shirley</firstname>
   <lastname>Doe</lastname>
   <address>2412 West Washington Ave</address>
   <city>West Bend</city>
   <state>WI</state>
   <zipcode>53095</zipcode>
   <homephone>2623349394</homephone>
   <workphone>2623386147</workphone>
   <cellphone>2626896732</cellphone>
   <pager></pager>
   <email>shirley@grandcare.com</email>
 </medication>
</gcapi>

json

{
   "gcapi": {
       "result": "SUCCESS",
       "medication": [
           {
               "id": "5f3e081d-e6af-4dd6-a6b8-dd4d8890e611",
               "firstname": "Shirley",
               "lastname": "Doe",
               "address": "2412 West Washington Ave",
               "city": "West Bend",
               "state": "WI",
               "zipcode": "53095",
               "homephone": "2623349394",
               "workphone": "2623386147",
               "cellphone": "2626896732",
               "pager": "",
               "email": "shirley@grandcare.com"
           }
       ]
   }
}

update

Updates an existing medication

Parameters

  • id - [required] - ID of medication to update
  • firstname - [optional] - First name
  • lastname - [optional] - Last name
  • email - [optional] - Email address
  • address - [optional] - Street address
  • city - [optional] - City
  • state - [optional] - State
  • zip - [optional] - Zip code
  • homephone - [optional] - Home phone number
  • workphone - [optional] - Work phone number
  • cellphone - [optional] - Cell phone number
  • pager - [optional] - Pager phone number

Results

Returns SUCCESS and a copy of the newly updated medication if successful, otherwise FAILURE. See the #read method for more information on the returned medication object.

delete

Deletes an existing medication

Parameters

  • id - [required] - ID of medication to delete

Results

Returns SUCCESS if the medication is deleted, otherwise FAILURE.

RxLookup

Looks up medication via FDA NDC Directory

Results

json

$ curl "http://10.100.1.2/api/medication.php?op=RxLookup&encoding=json&passcode=x&rxsearch=Synthroid
{
   "gcapi": {
       "result": "SUCCESS",
       "RxLookup": [
           {
               "ndc": "0074-3727",
               "brandName": "Synthroid",
               "ingredient": "Levothyroxine Sodium",
               "type": "TABLET",
               "route": "ORAL",
               "labeler": "Abbott Laboratories",
               "packages": [
                   {
                       "ndc": "0074-3727-13",
                       "packageDesc": "100 TABLET in 1 BOTTLE (0074-3727-13)"
                   },
                   {
                       "ndc": "0074-3727-19",
                       "packageDesc": "1000 TABLET in 1 BOTTLE (0074-3727-19)"
                   },
                   {
                       "ndc": "0074-3727-71",
                       "packageDesc": "4 BLISTER PACK in 1 CARTON (0074-3727-71)  > 7 TABLET in 1 BLISTER PACK"
                   },
                   {
                       "ndc": "0074-3727-90",
                       "packageDesc": "90 TABLET in 1 BOTTLE (0074-3727-90)"
                   }
               ],
               "dosages": [
                   {
                       "dose": "300 ug/1"
                   },
                   {
                       "dose": "200 ug/1"
                   },
                   {
                       "dose": "175 ug/1"
                   },
                   {
                       "dose": "150 ug/1"
                   },
                   {
                       "dose": "137 ug/1"
                   },
                   {
                       "dose": "125 ug/1"
                   },
                   {
                       "dose": "112 ug/1"
                   },
                   {
                       "dose": "100 ug/1"
                   },
                   {
                       "dose": "88 ug/1"
                   },
                   {
                       "dose": "75 ug/1"
                   },
                   {
                       "dose": "50 ug/1"
                   },
                   {
                       "dose": "25 ug/1"
                   },
                   {
                       "dose": ".112 mg/1"
                   },
                   {
                       "dose": ".125 mg/1"
                   },
                   {
                       "dose": ".175 mg/1"
                   },
                   {
                       "dose": ".3 mg/1"
                   },
                   {
                       "dose": ".1 mg/1"
                   },
                   {
                       "dose": ".075 mg/1"
                   },
                   {
                       "dose": ".05 mg/1"
                   },
                   {
                       "dose": ".088 mg/1"
                   },
                   {
                       "dose": ".2 mg/1"
                   },
                   {
                       "dose": ".025 mg/1"
                   },
                   {
                       "dose": ".15 mg/1"
                   },
                   {
                       "dose": ".137 mg/1"
                   }
               ]
           },
           {
               "ndc": "55154-0903",
               "brandName": "SYNTHROID",
               "ingredient": "levothyroxine sodium tablets",
               "type": "TABLET",
               "route": "ORAL",
               "labeler": "Cardinal Health",
               "packages": [
                   {
                       "ndc": "55154-0903-0",
                       "packageDesc": "10 BLISTER PACK in 1 BAG (55154-0903-0)  > 1 TABLET in 1 BLISTER PACK"
                   },
                   {
                       "ndc": "55154-0903-1",
                       "packageDesc": "100 TABLET in 1 BOTTLE (55154-0903-1)"
                   }
               ],
               "dosages": [
                   {
                       "dose": "300 ug/1"
                   },
                   {
                       "dose": "200 ug/1"
                   },
                   {
                       "dose": "175 ug/1"
                   },
                   {
                       "dose": "150 ug/1"
                   },
                   {
                       "dose": "125 ug/1"
                   },
                   {
                       "dose": "112 ug/1"
                   },
                   {
                       "dose": "100 ug/1"
                   },
                   {
                       "dose": "88 ug/1"
                   },
                   {
                       "dose": "75 ug/1"
                   },
                   {
                       "dose": "50 ug/1"
                   },
                   {
                       "dose": "25 ug/1"
                   }
               ]
           }
       ]
   }
}