Documentation ¶
Index ¶
- type Record
- func (r *Record) IsRiskFactorsComplete() bool
- func (r *Record) RiskFactorDateTime() (time.Time, error)
- func (r *Record) StudyIDString() string
- func (r *Record) ToPie(patientURL string) (pie *plugin.Pie, err error)
- func (r *Record) ToRiskServiceCalculationResult(patientURL string) (result *plugin.RiskServiceCalculationResult, err error)
- type Study
- type StudyMap
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Record ¶
type Record struct { StudyID interface{} `json:"study_id"` EventName string `json:"redcap_event_name"` RiskFactorDate string `json:"rf_date"` ClinicalRisk string `json:"rf_cmc_risk_cat"` FunctionalRisk string `json:"rf_func_risk_cat"` UtilizationRisk string `json:"rf_util_risk_cat"` PerceivedRisk string `json:"rf_risk_predicted"` }
Record represents the key info from a REDCap record in the risk stratification project
func (*Record) IsRiskFactorsComplete ¶
IsRiskFactorsComplete checks that the risk factors form was marked as complete, that a valid risk factor date was set, and that all risk factor scores are set
func (*Record) RiskFactorDateTime ¶
RiskFactorDateTime returns the parsed date/time for the risk factor form
func (*Record) StudyIDString ¶
StudyIDString returns a string representation of the study ID (which could be a string or a number)
func (*Record) ToPie ¶
ToPie converts the record to the Intervention Engine pie format used for identifying risk components. The corresponding patientURL must be passed in so the risk pie can be assiocated to the patient on the FHIR server. If the record doesn't have complete risk factors, it will result in an error.
func (*Record) ToRiskServiceCalculationResult ¶
func (r *Record) ToRiskServiceCalculationResult(patientURL string) (result *plugin.RiskServiceCalculationResult, err error)
ToRiskServiceCalculationResult converts the record to a RiskServiceCalculationResult. The corresponding patientURL must be passed in so the risk pie can be assiocated to the patient on the FHIR server. If the record doesn't have complete risk factors, it will result in an error.
type Study ¶
Study represents a single study / patient, containing all of the records making up the study
func (*Study) AddRecord ¶
AddRecord adds a record to the study, checking to ensure it has the same Study ID
func (*Study) ToRiskServiceCalculationResults ¶
func (s *Study) ToRiskServiceCalculationResults(patientURL string) []plugin.RiskServiceCalculationResult
ToRiskServiceCalculationResults converts the records to RiskServiceCalculationResults and returns them sorted by the AsOf date. Note that the size of the resulting list may be smaller than the size of the record list since some records may represent incomplete risk factors. The corresponding patientURL must be passed in so the risk pie can be assiocated to the patient on the FHIR server.
type StudyMap ¶
StudyMap is a simple map of studies indexed by the study ID, providing a few convenience functions
func (StudyMap) AddRecord ¶
AddRecord adds a record to the appropriate study in the map. If no corresponding study is found, adds a new study to the map.
func (StudyMap) AddRecords ¶
AddRecords adds a set of records, ensuring each record is associated with its matching study. If no corresponding study is found for a given record, adds a new study to the map.