Class: ClinicalServiceFactory

ClinicalServiceFactory

The clinical service factory is used to create clinical service instances. Each clinical domain has its own clinical service implementation. A clinical service factory keeps state by maintaining an internal service context object. This context object is passed to a clinical service upon creation of the service instance. The userId and facilityId values are immutable and passed to the constructor. The patientId is mutable and can be changed through the selectPatient method.

Constructor

new ClinicalServiceFactory(db, userId, facilityId)

Clinical service factory constructor.
Parameters:
Name Type Description
db Object VistA database instance.
userId String User identifier (e.g. 200-61)
facilityId String Facility identifier. (e.g. 4-2536)
Source:

Methods

createAllergyService() → {AllergyService}

Creates an AllergyService instance.
Source:
Throws:
Error if user hasn't been authenticated or a patient hasn't been selected.
Returns:
An AllergyService instance.
Type
AllergyService

createProblemService() → {ProblemService}

Creates a ProblemService instance.
Source:
Throws:
Error if user hasn't been authenticated or a patient hasn't been selected.
Returns:
A ProblemService instance.
Type
ProblemService

createVitalsService() → {VitalsService}

Creates a VitalsService instance.
Source:
Throws:
Error if user hasn't been authenticated or a patient hasn't been selected.
Returns:
A VitalsService instance.
Type
VitalsService

selectPatient(patientId)

Selects a patient. This method currently just stores the provided patientId in the object's serviceContext. It does not communicate with fileman yet. TODO set patient TMP fileman values
Parameters:
Name Type Description
patientId String Patient identifier. (e.g. 2-61)
Source: