Adding a drug order

<< Click to Display Table of Contents >>

Navigation:  Technical documentation > Importing data >

Adding a drug order

Previous pageReturn to chapter overviewNext page

The procedure AddDrug shown below takes a lot of parameters, but most can be set to NULL if they are not available during import, or if the data can not be reliably converted into the required format.

 

Adding a drug order

This is the definition of the procedure, as extracted from the FastTrak database.

 

PROCEDURE dbo.AddDrug( @PersonId INTEGER, @ATC varchar(7),           

       @DrugName varchar(64), @DrugForm varchar(64), @Strength decimal(12,4),

       @StrengthUnit varchar(24), @Dose24hCount decimal(12,4),

       @StartAt datetime, @StartFuzzy INTEGER,       

       @StartReason varchar(64), @DoseCode varchar(24),

       @RxText text, @TreatType char(1), @BatchId INT = NULL )

 

 

Parameter

NULLABLE?

Comment

PersonId

NOT NULL

The Person this drug was meant for. Required.

ATC

NULLABLE

ATC code (Anatomic Therapeutic Classification of drugs). Highly recommended.

DrugName

NOT NULL

Name of the drug, like "Lipitor" or "Embrel". Required.

DrugForm

NULLABLE

Examples: "Tablet", "Capsule", "Ointment"

Strength

NULLABLE

Strength of drug.  It is highly recommended to save this information whenever it is available.

StrengthUnit

NULLABLE

Unit for the strength, usually something like "mg" or "mg/ml".

Dose24hCount

NULLABLE

The number of doses per day.  For pills, the number of pills, for solutions the number of volume units.   E.g. for a mixture taken as 15 ml twice a day, this would be 30.

StartAt

NOT NULL

Timestamp for the start of this treatment, usually the time it was prescribed. Required.

StartFuzzy

NULLABLE

Uncertainty for the date StartAt.  Leave this at 0.

StartReason

NULLABLE

The reason this drug was started, e.g. "Hypercholesterolaemia" or "Sinusitis"

DoseCode

NULLABLE

A short text describing the dosing regimen, like "1 x 2" or "15 ml x 3".

RxText

NULLABLE

A description for how this drug should be used, i.e. instructions to the patient.

TreatType

NULLABLE

A code for the type of treatment.  "F" = standing order, "B" = as needed, "K" = time limited cure, "X" other or unspecified.  It is highly recommended to set TreatType F (standing order) when appropriate.

BatchId

NULLABLE

A valid BatchId, enforced with a foreign key constraint to the ImportBatch table.   Can also be NULL.

 
Stopping a drug order

The procedure AddDrug will return a dataset containing a field TreatId, which can be used for subsequent changes to this drug order.  A common use is to stop the drug order with the procedure UpdateDrugStop.

 

PROCEDURE dbo.UpdateDrugStop( @TreatId INTEGER, @StopAt datetime, @StopFuzzy integer = 0,

  @StopReason varchar(64) = NULL, @SaveThisReason integer = 1 )

 

To stop a drug order, call UpdateDrugStop with the TreatId, the stop date in StopAt.  The rest of the parameters are optional, and not needed for data import.