Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Expand
titlecreateProgramMedication
Code Block
"Creates a single `ProgramMedication`."
  createProgramMedication(
    input: CreateProgramMedicationInput!
  ): CreateProgramMedicationPayload

Code Block
"""
Input for `createProgramMedication` mutation.
User must have a scope **program_medication:write**
"""
input CreateProgramMedicationInput {
  "Id of medication"
  medicationId: ID!
  "Medical program Identifier"
  medicalProgramId: ID!
  "Reimbursement information"
  reimbursement: CreateReimbursementInput!
  "Factory gate price for package of medications"
  wholesalePrice: Float
  "Consumer price for package of medications"
  consumerPrice: Float
  "Reimbuersement amount for recommended daily dosage of medication"
  reimbursementDailyDosage: Float
  "The estimatied amount which patient should pay for package of medications after reimbursement"
  estimatedPaymentAmount: Float
  "Start date of action for this entry"
  startDate: Date
  "End date for this entry"
  endDate: Date
  "General registry identifier"
  registryNumber: String
}

"""
Input for `Reimbursement` of `createProgramMedication` mutation.
"""
input CreateReimbursementInput {
  "Reimbursement type"
  type: ReimbursementType!
  "Reimbursement amount"
  reimbursementAmount: Float
  "Percentage of reimbursement."
  percentageDiscount: Float
}
Code Block
"""
Return type for `createProgramMedication` mutation.
"""
type CreateProgramMedicationPayload {
  "Created `ProgramMedication`."
  programMedication: ProgramMedication
}

"""
Program Medication linkes medication and medical program.
In order to obtain details user must have a scope **program_medication:read**
"""
type ProgramMedication implements Node {
  "The ID of an object."
  id: ID!
  "Primary key identifier from the database."
  databaseId: UUID!
  "MedicalProgram."
  medicalProgram: MedicalProgram!
  "Medication"
  medication: Medication!
  "Reimbursement information."
  reimbursement: Reimbursement!
  "Factory gate price for package of medications"
  wholesalePrice: Float
  "Consumer price for package of medications"
  consumerPrice: Float
  "Reimbuersement amount for recommended daily dosage of medication"
  reimbursementDailyDosage: Float
  "The estimatied amount which patient should pay for package of medications after reimbursement"
  estimatedPaymentAmount: Float
  "Start date of action for this entry"
  startDate: Date
  "End date for this entry"
  endDate: Date
  "General registry identifier"
  registryNumber: String
  "Whether `ProgramMedication` is active or not?"
  isActive: Boolean!
  "Whether requesting medications allowed for the `ProgramMedication` or not?"
  medicationRequestAllowed: Boolean!
  "Date and time when record was inserted"
  insertedAt: DateTime!
  "Date and time when record was updated"
  updatedAt: DateTime!
}

Request structure

...

See on Apiary

Expand
titleRequest example
Code Block
{
  "medication_id": "59781de0-2e64-4359-b716-bcc05a32c10f",
  "medical_program_id": "e1453f4c-1077-4e85-8c98-c13ffca0063e",
  "reimbursement": {
    "type": "fixed",
    "reimbursement_amount": 450
  },
  "wholesale_price": "148.50",
  "consumer_price": "150.00",
  "daily_dosage": "200",
  "reimbursement_daily_dosage": "10.4858",
  "estimated_payment_amount": "34.50"
}

...

  • Verify the validity of access token

    • in case of error - return 401 (“Invalid access token”) in case of validation fails.

  • Verify that token is not expired

    • in case of error - return 401 (“Invalid access token”).

  • Check user scopes in order to perform this action (scope = 'program_medication:write')

    • return 403 (“Your scope does not allow to access this resource. Missing allowances: program_medication:read”) in case of invalid scope(s).

...