Documentation ¶
Overview ¶
Package dmd provides functionality to process and understand data from the UK Dictionary of Medicines and Devices (dm+d). This is, by definition, a UK-only module and will not give expected results for drugs outside of the UK Product root.
The dm+d model consists of the following components: VTM VMP VMPP TF AMP AMPP
The relationships between these components are:
VMP <<- IS_A -> VTM VMP <<- HAS_SPECIFIC_ACTIVE_INGREDIENT ->> SUBSTANCE VMP <<- HAS_DISPENSED_DOSE_FORM ->> QUALIFIER VMPP <<- HAS_VMP -> VMP AMPP <<- IS_A -> VMPP AMPP <<- HAS_AMP -> AMP AMP <<- IS_A -> VMP AMP <<- IS_A -> TF AMP <<- HAS_EXCIPIENT ->> QUALIFIER TF <<- HAS_TRADE_FAMILY_GROUP ->> QUALIFIER
Cardinality rules are: (see https://www.nhsbsa.nhs.uk/sites/default/files/2017-02/Technical_Specification_of_data_files_R2_v3.1_May_2015.pdf) The SNOMED dm+d data file documents the cardinality rules for AMP<->TF (https://www.nhsbsa.nhs.uk/sites/default/files/2017-04/doc_UKTCSnomedCTUKDrugExtensionEditorialPolicy_Current-en-GB_GB1000001_v7_0.pdf)
Index ¶
- Constants
- type AMP
- func (amp AMP) AMPPs() (result []int64, err error)
- func (amp AMP) ControlledDrugStatus() int64
- func (amp AMP) Excipients() (excipients []int64)
- func (amp AMP) TF() (tf int64, err error)
- func (amp AMP) VMP() (vmp int64, err error)
- func (amp AMP) VMPNonAvailabilityIndicator() int64
- func (amp AMP) VMPPrescribingStatus() int64
- type Product
- func (p Product) IsAMP() bool
- func (p Product) IsAMPP() bool
- func (p Product) IsInReferenceSet(refset int64) bool
- func (p Product) IsProduct() bool
- func (p Product) IsSugarFree() bool
- func (p Product) IsTradeFamily() bool
- func (p Product) IsVMP() bool
- func (p Product) IsVMPP() bool
- func (p Product) IsVTM() bool
- func (p Product) PrettyPrint() string
- func (p Product) Relationship(relationshipType int64) int64
- func (p Product) Relationships(relationshipType int64) (result []int64)
- func (p Product) String() string
- type TF
- type VMP
- func (vmp VMP) AMPs(ctx context.Context) (result []int64, err error)
- func (vmp VMP) AllAMPs(ctx context.Context) (result []int64, err error)
- func (vmp VMP) DisposedDoseForm() int64
- func (vmp VMP) HasBasisOfStrength() []int64
- func (vmp VMP) HasNHSControlledDrugCategory() int64
- func (vmp VMP) HasNHSdmdVmpOntologyFormAndRoute() int64
- func (vmp VMP) HasNHSdmdVmpRouteAdministration() int64
- func (vmp VMP) HasPresentationStrengthDenominator() []int64
- func (vmp VMP) HasPresentationStrengthNumerator() []int64
- func (vmp VMP) HasPresentationStrengthNumeratorUnit() []int64
- func (vmp VMP) PrescribingStatus() (valid, recommended bool)
- func (vmp VMP) SpecificActiveIngredients() (result []int64)
- func (vmp VMP) VMPPs() (result []int64, err error)
- func (vmp VMP) VTMs() (result []int64)
- type VTM
Constants ¶
const ( // Core concepts - types of dm+d product UKProduct = 10363601000001109 ActualMedicinalProduct = 10363901000001102 ActualMedicinalProductPack = 10364001000001104 VirtualMedicinalProduct = 10363801000001108 VirtualMedicinalProductPack = 8653601000001108 VirtuaTherapeuticMoiety = 10363701000001104 TradeFamily = 9191801000001103 // dm+d reference sets - membership of a reference set tells us which of six types of product VtmReferenceSet = 999000581000001102 TfReferenceSet = 999000631000001100 AmpReferenceSet = 999000541000001108 AmppReferenceSet = 999000551000001106 VmpReferenceSet = 999000561000001109 VmppReferenceSet = 999000571000001104 // Language reference sets NhsDmdRealmLanguageReferenceSet = 999000671000001103 // language reference set - dm+d NhsRealmPharmacyLanguageReferenceSet = 999000691000001104 NhsRealmClinicalLanguageReferenceSet = 999001261000000100 NhsEPrescribingRouteAdministrationReferenceSet = 999000051000001100 // Other reference sets DoseFormReferenceSet = 999000781000001107 SugarFreeReferenceSet = 999000601000001109 GlutenFreeReferenceSet = 999000611000001106 PreservativeFreeReferenceSet = 999000621000001102 CombinationDrugVtm = 999000771000001105 ChlorofluorocarbonFreeReferenceSet = 999000651000001105 BlackTriangleReferenceSet = 999000661000001108 // Important relevant relationship types for dm+d concepts IsA = 116680003 PendingMove = 900000000000492006 HasActiveIngredient = 127489000 HasVmp = 10362601000001103 HasAmp = 10362701000001108 HasTradeFamilyGroup = 9191701000001107 HasSpecificActiveIngredient = 10362801000001104 HasDispensedDoseForm = 10362901000001105 // UK dm+d version of "HasDoseForm" HasDoseForm = 411116001 // Do not use - from International release - use dm+d relationship instead HasExcipient = 8653101000001104 PrescribingStatus = 8940001000001105 NonAvailabilityIndicator = 8940601000001102 LegalCategory = 8941301000001102 DiscontinuedIndicator = 8941901000001101 HasBasisOfStrength = 10363001000001101 HasUnitOfAdministration = 13085501000001109 HasUnitOfPresentation = 763032000 HasNHSdmdBasisOfStrength = 10363001000001101 HasNHSControlledDrugCategory = 13089101000001102 HasVMPNonAvailabilityIndicator = 8940601000001102 VMPPrescribingStatus = 8940001000001105 HasNHSdmdVmpRouteOfAdministration = 13088401000001104 HasNHSdmdVmpOntologyFormAndRoute = 13088501000001100 HasPresentationStrengthNumerator = 732944001 HasPresentationStrengthDenominator = 732946004 HasPresentationStrengthNumeratorUnit = 732945000 )
dm+d related constants - definitions of relationship types
const ( CautionAMPLevelPrescribingAdvised = 13291401000001100 NeverValidToPrescribeAsVrp = 12459601000001102 NeverValidToPrescribeAsVmp = 8940401000001100 NotRecommendedToPrescribeAsVmp = 8940501000001101 InvalidAsPrescribableProduct = 8940301000001108 NotRecommendedBrandsNotBioequivalent = 9900001000001104 NotRecommendedNoProductSpecification = 12468201000001102 NotRecommendedPatientTraining = 9900101000001103 VmpValidAsPrescribableProduct = 8940201000001104 VrpValidAsPrescribableProduct = 12223601000001104 )
Prescribing status - descendants of 8940101000001106 - https://termbrowser.nhs.uk/?perspective=full&conceptId1=8940101000001106&edition=uk-edition&release=v20181001&server=https://termbrowser.nhs.uk/sct-browser-api/snomed&langRefset=999001261000000100,999000691000001104
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AMP ¶
type AMP struct {
Product
}
AMP is an actual medicinal product It is related to other components thusly: AMPP - HAS_AMP - AMP AMP - IS_A - VMP AMP - IS_A - TF AMP - HAS_EXCIPIENT - QUALIFIER
func NewAMP ¶
func NewAMP(svc *terminology.Svc, ec *snomed.ExtendedConcept) (*AMP, error)
NewAMP creates a new AMP from the specified concept. It is an error to use a concept that is not a AMP
func (AMP) ControlledDrugStatus ¶
ControlledDrugStatus returns the NHS controlled drug category which is a child of "13089201000001109".
func (AMP) Excipients ¶
Excipients returns the excipients for this AMP / AMP - HAS_EXCIPIENT - QUALIFIER If there are no excipients, dm+d explicitly returns "8653301000001102 = Excipient Not Declared"
func (AMP) VMPNonAvailabilityIndicator ¶
VMPNonAvailabilityIndicator returns whether the AMP's VMP is available, or not
func (AMP) VMPPrescribingStatus ¶
VMPPrescribingStatus returns whether the AMP's VMP is prescribable.
type Product ¶
type Product struct { *snomed.ExtendedConcept // contains filtered or unexported fields }
Product is any dm+d product
func NewProduct ¶
func NewProduct(svc *terminology.Svc, ec *snomed.ExtendedConcept) Product
NewProduct creates a new UK dm+d product
func (Product) IsAMPP ¶
IsAMPP returns whether this product is an Actual Medicinal Product Pack (AMPP)
func (Product) IsInReferenceSet ¶
IsInReferenceSet returns whether the product is in the specified reference set or not
func (Product) IsSugarFree ¶
IsSugarFree returns whether this product is flagged as sugar-free
func (Product) IsTradeFamily ¶
IsTradeFamily returns whether this product is a trade family (TF)
func (Product) IsVMPP ¶
IsVMPP returns whether this product is a virtual medicinal product pack (VMPP)
func (Product) PrettyPrint ¶
PrettyPrint provides a pretty formatted version of this product.
func (Product) Relationship ¶
Relationship returns the single active relationship of the specified type.
func (Product) Relationships ¶
Relationships returns the active (parent) relationships of the specified type.
type TF ¶
type TF struct {
Product
}
TF is a trade family and is related to other components in dm+d thusly: AMP <<- IS_A -> TF TF <<- HAS_TRADE_FAMILY_GROUP ->> QUALIFIER
func NewTF ¶
func NewTF(svc *terminology.Svc, ec *snomed.ExtendedConcept) (*TF, error)
NewTF creates a new TF from the specified concept. It is an error to use a concept that is not a TF
func (TF) TradeFamilyGroup ¶
TradeFamilyGroup returns the trade family group for this trade family.
type VMP ¶
type VMP struct {
Product
}
VMP is a virtual medicinal product. It is related to other dm+d models thusly:
VMP -> IS-A -> VTM VMPP -> HAS VMP -> VMP AMP -> IS-A -> VMP VMP -> HAS_DISPENSED_DOSE_FORM -> [...] VMP -> HAS_SPECIFIC_ACTIVE_INGREDIENT -> [...]
func NewVMP ¶
func NewVMP(svc *terminology.Svc, ec *snomed.ExtendedConcept) (*VMP, error)
NewVMP creates a new VMP from the specified concept. It is an error to use a concept that is not a VMP
func (VMP) AMPs ¶
AMPs returns the AMP(s) for the given VMP AMP -> IS-A -> VMP Note, this method does not include AMPs for child VMPs of this VMP.
func (VMP) AllAMPs ¶
AllAMPs return all (recursive) AMPs for this VMP Because a VMP can have children that are VMPs, this returns AMPs for this VMP *and* child VMPs. In most use-cases, use AMPs() instead.
func (VMP) DisposedDoseForm ¶
DisposedDoseForm returns the disposed dose form of this VMP
VMP -> HAS_DISPENSED_DOSE_FORM -> [...]
func (VMP) HasBasisOfStrength ¶
HasBasisOfStrength returns NHS dm+d determined basis of strength
func (VMP) HasNHSControlledDrugCategory ¶
HasNHSControlledDrugCategory returns the controlled drug category for this VMP
func (VMP) HasNHSdmdVmpOntologyFormAndRoute ¶
HasNHSdmdVmpOntologyFormAndRoute returns the ontology form and route for this VMP
func (VMP) HasNHSdmdVmpRouteAdministration ¶
HasNHSdmdVmpRouteAdministration returns the route of administration for this VMP
func (VMP) HasPresentationStrengthDenominator ¶
HasPresentationStrengthDenominator returns the presentation strength denominator
func (VMP) HasPresentationStrengthNumerator ¶
HasPresentationStrengthNumerator returns the presentation strength numerator
func (VMP) HasPresentationStrengthNumeratorUnit ¶
HasPresentationStrengthNumeratorUnit returns the presentation strength numerator unit
func (VMP) PrescribingStatus ¶
PrescribingStatus returns whether this VMP can be prescribed
func (VMP) SpecificActiveIngredients ¶
SpecificActiveIngredients returns the ingredients for this VMP
VMP -> HAS_SPECIFIC_ACTIVE_INGREDIENT -> [...]
type VTM ¶
type VTM struct {
Product
}
VTM is a Virtual Therapeutic Moiety It will no have HAS_INGREDIENT relationship itself as part of dm+d, but the International release may include some with that type of relationship. That means derivation of ingredients, for dm+d products, is via VMP. See https://www.nhsbsa.nhs.uk/sites/default/files/2017-12/doc_UKTCSnomedCTUKDrugExtensionEditorialPolicy_Current-en-GB_GB1000001_20171227.pdf
It is related to other components in dm+d thusly: VMP - IS_A - VTM
func NewVTM ¶
func NewVTM(svc *terminology.Svc, ec *snomed.ExtendedConcept) (*VTM, error)
NewVTM creates a new VTM from the specified concept. It is an error to use a concept that is not a VTM
func (VTM) AllVMPs ¶
AllVMPs returns the VMPs for this VTM Recursive children will include VMPS and AMPs. Direct children will include other VTMs. ie. you can have VMP -IS-A- VMP -IS-A- VMP -IS-A- VTM We therefore need to recursively search children, and filter both. // VMP - IS_A - VTM // VMP - IS_A - VMP - IS_A - VTM // VMP - IS_A - VTM - IS_A - VTM
func (VTM) SpecificActiveIngredients ¶
SpecificActiveIngredients returns the specific active ingredients for this VTM This simply returns the active ingredients via its (direct) VMPs.