dmd

package
v1.0.1-0...-ff3196c Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 23, 2020 License: Apache-2.0 Imports: 7 Imported by: 0

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.

See https://www.nhsbsa.nhs.uk/sites/default/files/2018-10/doc_SnomedCTUKDrugExtensionModel%20-%20v1.0.pdf

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

View Source
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

View Source
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) AMPPs

func (amp AMP) AMPPs() (result []int64, err error)

AMPPs returns the AMPPs for the given AMP AMPP - HAS_AMP - AMP

func (AMP) ControlledDrugStatus

func (amp AMP) ControlledDrugStatus() int64

ControlledDrugStatus returns the NHS controlled drug category which is a child of "13089201000001109".

func (AMP) Excipients

func (amp AMP) Excipients() (excipients []int64)

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) TF

func (amp AMP) TF() (tf int64, err error)

TF returns the trade family for this AMP AMP - IS_A - TF

func (AMP) VMP

func (amp AMP) VMP() (vmp int64, err error)

VMP returns the VMP for the given AMP AMP - IS_A - VMP

func (AMP) VMPNonAvailabilityIndicator

func (amp AMP) VMPNonAvailabilityIndicator() int64

VMPNonAvailabilityIndicator returns whether the AMP's VMP is available, or not

func (AMP) VMPPrescribingStatus

func (amp AMP) VMPPrescribingStatus() int64

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) IsAMP

func (p Product) IsAMP() bool

IsAMP returns whether this product is an Actual Medicinal Product (AMP)

func (Product) IsAMPP

func (p Product) IsAMPP() bool

IsAMPP returns whether this product is an Actual Medicinal Product Pack (AMPP)

func (Product) IsInReferenceSet

func (p Product) IsInReferenceSet(refset int64) bool

IsInReferenceSet returns whether the product is in the specified reference set or not

func (Product) IsProduct

func (p Product) IsProduct() bool

IsProduct confirms that this is a UK dm+d product.

func (Product) IsSugarFree

func (p Product) IsSugarFree() bool

IsSugarFree returns whether this product is flagged as sugar-free

func (Product) IsTradeFamily

func (p Product) IsTradeFamily() bool

IsTradeFamily returns whether this product is a trade family (TF)

func (Product) IsVMP

func (p Product) IsVMP() bool

IsVMP returns whether this product is a virtual medicinal product (VMP)

func (Product) IsVMPP

func (p Product) IsVMPP() bool

IsVMPP returns whether this product is a virtual medicinal product pack (VMPP)

func (Product) IsVTM

func (p Product) IsVTM() bool

IsVTM returns whether this product is a virtual therapeutic moiety (VTM)

func (Product) PrettyPrint

func (p Product) PrettyPrint() string

PrettyPrint provides a pretty formatted version of this product.

func (Product) Relationship

func (p Product) Relationship(relationshipType int64) int64

Relationship returns the single active relationship of the specified type.

func (Product) Relationships

func (p Product) Relationships(relationshipType int64) (result []int64)

Relationships returns the active (parent) relationships of the specified type.

func (Product) String

func (p Product) String() string

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) AMPs

func (tf TF) AMPs(ctx context.Context) (result []int64, err error)

AMPs returns the AMPs for this TF AMP <<- IS_A -> TF

func (TF) TradeFamilyGroup

func (tf TF) TradeFamilyGroup() int64

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

func (vmp VMP) AMPs(ctx context.Context) (result []int64, err error)

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

func (vmp VMP) AllAMPs(ctx context.Context) (result []int64, err error)

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

func (vmp VMP) DisposedDoseForm() int64

DisposedDoseForm returns the disposed dose form of this VMP

VMP -> HAS_DISPENSED_DOSE_FORM -> [...]

func (VMP) HasBasisOfStrength

func (vmp VMP) HasBasisOfStrength() []int64

HasBasisOfStrength returns NHS dm+d determined basis of strength

func (VMP) HasNHSControlledDrugCategory

func (vmp VMP) HasNHSControlledDrugCategory() int64

HasNHSControlledDrugCategory returns the controlled drug category for this VMP

func (VMP) HasNHSdmdVmpOntologyFormAndRoute

func (vmp VMP) HasNHSdmdVmpOntologyFormAndRoute() int64

HasNHSdmdVmpOntologyFormAndRoute returns the ontology form and route for this VMP

func (VMP) HasNHSdmdVmpRouteAdministration

func (vmp VMP) HasNHSdmdVmpRouteAdministration() int64

HasNHSdmdVmpRouteAdministration returns the route of administration for this VMP

func (VMP) HasPresentationStrengthDenominator

func (vmp VMP) HasPresentationStrengthDenominator() []int64

HasPresentationStrengthDenominator returns the presentation strength denominator

func (VMP) HasPresentationStrengthNumerator

func (vmp VMP) HasPresentationStrengthNumerator() []int64

HasPresentationStrengthNumerator returns the presentation strength numerator

func (VMP) HasPresentationStrengthNumeratorUnit

func (vmp VMP) HasPresentationStrengthNumeratorUnit() []int64

HasPresentationStrengthNumeratorUnit returns the presentation strength numerator unit

func (VMP) PrescribingStatus

func (vmp VMP) PrescribingStatus() (valid, recommended bool)

PrescribingStatus returns whether this VMP can be prescribed

func (VMP) SpecificActiveIngredients

func (vmp VMP) SpecificActiveIngredients() (result []int64)

SpecificActiveIngredients returns the ingredients for this VMP

VMP -> HAS_SPECIFIC_ACTIVE_INGREDIENT -> [...]

func (VMP) VMPPs

func (vmp VMP) VMPPs() (result []int64, err error)

VMPPs returns the VMPPs for this VMP

func (VMP) VTMs

func (vmp VMP) VTMs() (result []int64)

VTMs returns the VTM(s) for the given VMP

VMP -> IS-A -> VTM

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

func (vtm VTM) AllVMPs(ctx context.Context) (result []int64, err error)

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

func (vtm VTM) SpecificActiveIngredients(ctx context.Context, tags []language.Tag) ([]int64, error)

SpecificActiveIngredients returns the specific active ingredients for this VTM This simply returns the active ingredients via its (direct) VMPs.

func (VTM) VMPs

func (vtm VTM) VMPs(ctx context.Context) (result []int64, err error)

VMPs returns only direct IS-A VMPs for this VTM.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL