Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ConditionCodeBSONBuilder = func(param search.SearchParam, searcher *search.MongoSearcher) (object bson.M, err error) { cc, ok := param.(*ConditionCodeParam) if !ok { return nil, errors.New("Expected a ConditionCodeParam") } // First get a list of patient IDs for this condition var subjectWrappers []struct { Subject *models.Reference `bson:"subject,omitempty"` } if err := searcher.GetDB().C("conditions").Find(bson.M{"code.coding.code": cc.Code}).Select(bson.M{"_id": 0, "subject": 1}).All(&subjectWrappers); err != nil { return nil, err } patientIds := []string{} for _, wrapper := range subjectWrappers { if wrapper.Subject.Type == "Patient" { patientIds = append(patientIds, wrapper.Subject.ReferencedID) } } return bson.M{ "_id": bson.M{ "$in": patientIds, }, }, nil }
ConditionCodeBSONBuilder builds the Mongo BSON object corresponding to the query by Patient condition.
View Source
var ConditionCodeParamInfo = search.SearchParamInfo{
Resource: "Patient",
Name: "condition-code",
Type: "synthma.patient_condition_code",
}
ConditionCodeParamInfo represents the condition-code for Patients' conditions. This allows patients to be searched by conditions they have.
View Source
var ConditionCodeParamParser = func(info search.SearchParamInfo, data search.SearchParamData) (search.SearchParam, error) { return &ConditionCodeParam{ TokenParam: *search.ParseTokenParam(data.Value, info), }, nil }
ConditionCodeParamParser parses the parameter and returns a ConditionCodeParam.
Functions ¶
This section is empty.
Types ¶
type ConditionCodeParam ¶
type ConditionCodeParam struct {
search.TokenParam
}
ConditionCodeParam represents the condition-code search parameter. Patient's may be searched by conditions they have using a combination of system and code. This behaves exactly the same as a standard TokenParam. See: http://hl7.org/fhir/2016Sep/search.html#token
Click to show internal directories.
Click to hide internal directories.