Skip to content

Commit

Permalink
Fix Partially Wrong Codes in ValueSets
Browse files Browse the repository at this point in the history
Closes: #8
  • Loading branch information
alexanderkiel committed Nov 7, 2021
1 parent 97bf950 commit faa46c8
Show file tree
Hide file tree
Showing 17 changed files with 635 additions and 102 deletions.
2 changes: 1 addition & 1 deletion fhir-models-gen/cmd/valueSet.go
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ func codes(valueSetName string, concepts []fhir.CodeSystemConcept) func(group *j
for _, concept := range concepts {
group.Case(jen.Id(codeIdentifier(valueSetName, concept.Code))).Block(jen.Return(jen.Lit(concept.Code)))
if len(concept.Concept) > 0 {
displays(valueSetName, concept.Concept)(group)
codes(valueSetName, concept.Concept)(group)
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion fhir-models-gen/fhir/aggregationMode.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ func (code AggregationMode) Code() string {
case AggregationModeReferenced:
return "referenced"
case AggregationModeBundled:
return "Bundled"
return "bundled"
}
return "<unknown>"
}
Expand Down
6 changes: 3 additions & 3 deletions fhir-models-gen/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ module github.com/samply/golang-fhir-models/fhir-models-gen
go 1.17

require (
github.com/dave/jennifer v1.4.0
github.com/spf13/cobra v0.0.5
github.com/dave/jennifer v1.4.1
github.com/spf13/cobra v1.2.1
)

require (
github.com/inconshreveable/mousetrap v1.0.0 // indirect
github.com/spf13/pflag v1.0.3 // indirect
github.com/spf13/pflag v1.0.5 // indirect
)
581 changes: 557 additions & 24 deletions fhir-models-gen/go.sum

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion fhir-models/fhir/aggregationMode.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ func (code AggregationMode) Code() string {
case AggregationModeReferenced:
return "referenced"
case AggregationModeBundled:
return "Bundled"
return "bundled"
}
return "<unknown>"
}
Expand Down
2 changes: 1 addition & 1 deletion fhir-models/fhir/carePlanActivityStatus.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ func (code CarePlanActivityStatus) Code() string {
case CarePlanActivityStatusCancelled:
return "cancelled"
case CarePlanActivityStatusStopped:
return "Stopped"
return "stopped"
case CarePlanActivityStatusUnknown:
return "unknown"
case CarePlanActivityStatusEnteredInError:
Expand Down
8 changes: 4 additions & 4 deletions fhir-models/fhir/carePlanIntent.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,13 +81,13 @@ func (code CarePlanIntent) Code() string {
case CarePlanIntentOrder:
return "order"
case CarePlanIntentOriginalOrder:
return "Original Order"
return "original-order"
case CarePlanIntentReflexOrder:
return "Reflex Order"
return "reflex-order"
case CarePlanIntentFillerOrder:
return "Filler Order"
return "filler-order"
case CarePlanIntentInstanceOrder:
return "Instance Order"
return "instance-order"
case CarePlanIntentOption:
return "option"
}
Expand Down
16 changes: 8 additions & 8 deletions fhir-models/fhir/conceptMapEquivalence.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,23 +78,23 @@ func (code ConceptMapEquivalence) Code() string {
case ConceptMapEquivalenceRelatedto:
return "relatedto"
case ConceptMapEquivalenceEquivalent:
return "Equivalent"
return "equivalent"
case ConceptMapEquivalenceEqual:
return "Equal"
return "equal"
case ConceptMapEquivalenceWider:
return "Wider"
return "wider"
case ConceptMapEquivalenceSubsumes:
return "Subsumes"
return "subsumes"
case ConceptMapEquivalenceNarrower:
return "Narrower"
return "narrower"
case ConceptMapEquivalenceSpecializes:
return "Specializes"
return "specializes"
case ConceptMapEquivalenceInexact:
return "Inexact"
return "inexact"
case ConceptMapEquivalenceUnmatched:
return "unmatched"
case ConceptMapEquivalenceDisjoint:
return "Disjoint"
return "disjoint"
}
return "<unknown>"
}
Expand Down
6 changes: 3 additions & 3 deletions fhir-models/fhir/diagnosticReportStatus.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,15 +80,15 @@ func (code DiagnosticReportStatus) Code() string {
case DiagnosticReportStatusPartial:
return "partial"
case DiagnosticReportStatusPreliminary:
return "Preliminary"
return "preliminary"
case DiagnosticReportStatusFinal:
return "final"
case DiagnosticReportStatusAmended:
return "amended"
case DiagnosticReportStatusCorrected:
return "Corrected"
return "corrected"
case DiagnosticReportStatusAppended:
return "Appended"
return "appended"
case DiagnosticReportStatusCancelled:
return "cancelled"
case DiagnosticReportStatusEnteredInError:
Expand Down
6 changes: 3 additions & 3 deletions fhir-models/fhir/goalLifecycleStatus.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,11 +79,11 @@ func (code GoalLifecycleStatus) Code() string {
case GoalLifecycleStatusAccepted:
return "accepted"
case GoalLifecycleStatusActive:
return "Active"
return "active"
case GoalLifecycleStatusOnHold:
return "On Hold"
return "on-hold"
case GoalLifecycleStatusCompleted:
return "Completed"
return "completed"
case GoalLifecycleStatusCancelled:
return "cancelled"
case GoalLifecycleStatusEnteredInError:
Expand Down
52 changes: 26 additions & 26 deletions fhir-models/fhir/issueType.go
Original file line number Diff line number Diff line change
Expand Up @@ -141,63 +141,63 @@ func (code IssueType) Code() string {
case IssueTypeInvalid:
return "invalid"
case IssueTypeStructure:
return "Structural Issue"
return "structure"
case IssueTypeRequired:
return "Required element missing"
return "required"
case IssueTypeValue:
return "Element value invalid"
return "value"
case IssueTypeInvariant:
return "Validation rule failed"
return "invariant"
case IssueTypeSecurity:
return "security"
case IssueTypeLogin:
return "Login Required"
return "login"
case IssueTypeUnknown:
return "Unknown User"
return "unknown"
case IssueTypeExpired:
return "Session Expired"
return "expired"
case IssueTypeForbidden:
return "Forbidden"
return "forbidden"
case IssueTypeSuppressed:
return "Information Suppressed"
return "suppressed"
case IssueTypeProcessing:
return "processing"
case IssueTypeNotSupported:
return "Content not supported"
return "not-supported"
case IssueTypeDuplicate:
return "Duplicate"
return "duplicate"
case IssueTypeMultipleMatches:
return "Multiple Matches"
return "multiple-matches"
case IssueTypeNotFound:
return "Not Found"
return "not-found"
case IssueTypeDeleted:
return "Deleted"
return "deleted"
case IssueTypeTooLong:
return "Content Too Long"
return "too-long"
case IssueTypeCodeInvalid:
return "Invalid Code"
return "code-invalid"
case IssueTypeExtension:
return "Unacceptable Extension"
return "extension"
case IssueTypeTooCostly:
return "Operation Too Costly"
return "too-costly"
case IssueTypeBusinessRule:
return "Business Rule Violation"
return "business-rule"
case IssueTypeConflict:
return "Edit Version Conflict"
return "conflict"
case IssueTypeTransient:
return "transient"
case IssueTypeLockError:
return "Lock Error"
return "lock-error"
case IssueTypeNoStore:
return "No Store Available"
return "no-store"
case IssueTypeException:
return "Exception"
return "exception"
case IssueTypeTimeout:
return "Timeout"
return "timeout"
case IssueTypeIncomplete:
return "Incomplete Results"
return "incomplete"
case IssueTypeThrottled:
return "Throttled"
return "throttled"
case IssueTypeInformational:
return "informational"
}
Expand Down
2 changes: 1 addition & 1 deletion fhir-models/fhir/nameUse.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ func (code NameUse) Code() string {
case NameUseOld:
return "old"
case NameUseMaiden:
return "Name changed for Marriage"
return "maiden"
}
return "<unknown>"
}
Expand Down
2 changes: 1 addition & 1 deletion fhir-models/fhir/observationStatus.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ func (code ObservationStatus) Code() string {
case ObservationStatusAmended:
return "amended"
case ObservationStatusCorrected:
return "Corrected"
return "corrected"
case ObservationStatusCancelled:
return "cancelled"
case ObservationStatusEnteredInError:
Expand Down
8 changes: 4 additions & 4 deletions fhir-models/fhir/provenanceEntityRole.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,13 +63,13 @@ func (code ProvenanceEntityRole) Code() string {
case ProvenanceEntityRoleDerivation:
return "derivation"
case ProvenanceEntityRoleRevision:
return "Revision"
return "revision"
case ProvenanceEntityRoleQuotation:
return "Quotation"
return "quotation"
case ProvenanceEntityRoleSource:
return "Source"
return "source"
case ProvenanceEntityRoleRemoval:
return "Removal"
return "removal"
}
return "<unknown>"
}
Expand Down
28 changes: 14 additions & 14 deletions fhir-models/fhir/questionnaireItemType.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,33 +103,33 @@ func (code QuestionnaireItemType) Code() string {
case QuestionnaireItemTypeQuestion:
return "question"
case QuestionnaireItemTypeBoolean:
return "Boolean"
return "boolean"
case QuestionnaireItemTypeDecimal:
return "Decimal"
return "decimal"
case QuestionnaireItemTypeInteger:
return "Integer"
return "integer"
case QuestionnaireItemTypeDate:
return "Date"
return "date"
case QuestionnaireItemTypeDateTime:
return "Date Time"
return "dateTime"
case QuestionnaireItemTypeTime:
return "Time"
return "time"
case QuestionnaireItemTypeString:
return "String"
return "string"
case QuestionnaireItemTypeText:
return "Text"
return "text"
case QuestionnaireItemTypeUrl:
return "Url"
return "url"
case QuestionnaireItemTypeChoice:
return "Choice"
return "choice"
case QuestionnaireItemTypeOpenChoice:
return "Open Choice"
return "open-choice"
case QuestionnaireItemTypeAttachment:
return "Attachment"
return "attachment"
case QuestionnaireItemTypeReference:
return "Reference"
return "reference"
case QuestionnaireItemTypeQuantity:
return "Quantity"
return "quantity"
}
return "<unknown>"
}
Expand Down
8 changes: 4 additions & 4 deletions fhir-models/fhir/requestIntent.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,13 +81,13 @@ func (code RequestIntent) Code() string {
case RequestIntentOrder:
return "order"
case RequestIntentOriginalOrder:
return "Original Order"
return "original-order"
case RequestIntentReflexOrder:
return "Reflex Order"
return "reflex-order"
case RequestIntentFillerOrder:
return "Filler Order"
return "filler-order"
case RequestIntentInstanceOrder:
return "Instance Order"
return "instance-order"
case RequestIntentOption:
return "option"
}
Expand Down
6 changes: 3 additions & 3 deletions fhir-models/fhir/triggerType.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,11 +76,11 @@ func (code TriggerType) Code() string {
case TriggerTypeDataChanged:
return "data-changed"
case TriggerTypeDataAdded:
return "Data Added"
return "data-added"
case TriggerTypeDataModified:
return "Data Updated"
return "data-modified"
case TriggerTypeDataRemoved:
return "Data Removed"
return "data-removed"
case TriggerTypeDataAccessed:
return "data-accessed"
case TriggerTypeDataAccessEnded:
Expand Down

0 comments on commit faa46c8

Please sign in to comment.