Direct Order Creation

POST {{URL}}/direct-order

Extremely useful and single API call that can create an order at PocketPills' end without calling 2 or 3 separate APIs. Is the fastest way to start with the integration. Individual apis shared below can be used for finer levels of control. * Patient won't be created if one is found for the existing details. * Data deduplication is automatically handled. * Instead of patient details object, you can only pass a patientId or providerPatientId, if it's a repeat order for a patient. Same would be true for an addressId, prescriptionId, insuranceId. * toOrder is a flag provided ( default is true ), in case you would want only to save the information but not create an order at the moment. The same payload with toOrder true later - will result in just the order creation. * Optional Fields : otcProducts, address, insurances, toOrder * For more details on entities (patient, address, insurance, prescriptions etc.), refer to the documentation of the respective entities in the other apis. Whatever rules have been written for them, would be applicable for this api as well.

Request Body

{"patient"=>{"phone"=>"9958893881", "providerPatientId"=>123, "firstName"=>"susan", "lastName"=>"smith", "birthDate"=>"1983-11-16", "gender"=>"MALE", "email"=>"email@test.com", "employer"=>"abc company", "provincialHealthCard"=>"BRITISH_COLUMBIA", "pocketPacks"=>true, "notes"=>"has x condition", "allergies"=>["nuts", "jaggery"], "medicalConditions"=>["diabetes"]}, "address"=>{"country"=>"CA", "name"=>"Home", "province"=>"British Columbia", "postalCode"=>"V3S7A4", "streetAddress"=>"18525 53 Ave", "streetAddressLineTwo"=>"#233", "city"=>"Surrey"}, "insurances"=>[{"images"=>[{"imageUrl"=>"https://pbs.twimg.com/media/EpjiIWTXcAQ27hD.jpg", "isFront"=>true}, {"imageUrl"=>"https://pbs.twimg.com/media/EpjiIWTXcAQ27hD.jpg", "isFront"=>false}], "type"=>"PRIMARY", "insuranceProvider"=>"GRSH", "cardNum"=>"23424"}], "prescriptions"=>[{"dateWritten"=>"2020-02-05T00:00:00.000Z", "prescriber"=>"Dr. Nathan Gork", "imageUrl"=>"https://pbs.twimg.com/media/EpjiIWTXcAQ27hD.jpg", "medications"=>[{"medicationName"=>"lipitor", "din"=>78, "medicationSig"=>"morning and evening", "totalQuantity"=>60, "currentFillQuantity"=>"30", "daysValid"=>30, "substitute"=>true, "toOrder"=>true}, {"medicationName"=>"Metformin", "din"=>79, "medicationSig"=>"3 times a day after food", "totalQuantity"=>60, "currentFillQuantity"=>"30", "daysValid"=>180, "substitute"=>true, "toOrder"=>true}]}], "otcProducts"=>[{"name"=>"Vitamin B", "quantity"=>2, "daysSupply"=>60}]}