This repository has been archived by the owner on Apr 29, 2024. It is now read-only.
forked from samply/golang-fhir-models
/
assertionOperatorType.go
159 lines (153 loc) · 4.62 KB
/
assertionOperatorType.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
// Copyright 2019 - 2022 The Samply Community
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package fhir
import (
"encoding/json"
"fmt"
"strings"
)
// THIS FILE IS GENERATED BY https://github.com/stat/golang-fhir-models
// PLEASE DO NOT EDIT BY HAND
// AssertionOperatorType is documented here http://hl7.org/fhir/ValueSet/assert-operator-codes
type AssertionOperatorType int
const (
AssertionOperatorTypeEquals AssertionOperatorType = iota
AssertionOperatorTypeNotEquals
AssertionOperatorTypeIn
AssertionOperatorTypeNotIn
AssertionOperatorTypeGreaterThan
AssertionOperatorTypeLessThan
AssertionOperatorTypeEmpty
AssertionOperatorTypeNotEmpty
AssertionOperatorTypeContains
AssertionOperatorTypeNotContains
AssertionOperatorTypeEval
)
func (code *AssertionOperatorType)MarshalJSON() ([]byte, error) {
return json.Marshal(code.Code())
}
func (code *AssertionOperatorType) UnmarshalJSON(json []byte) error {
s := strings.Trim(string(json), "\"")
switch s {
case "equals":
*code = AssertionOperatorTypeEquals
case "notEquals":
*code = AssertionOperatorTypeNotEquals
case "in":
*code = AssertionOperatorTypeIn
case "notIn":
*code = AssertionOperatorTypeNotIn
case "greaterThan":
*code = AssertionOperatorTypeGreaterThan
case "lessThan":
*code = AssertionOperatorTypeLessThan
case "empty":
*code = AssertionOperatorTypeEmpty
case "notEmpty":
*code = AssertionOperatorTypeNotEmpty
case "contains":
*code = AssertionOperatorTypeContains
case "notContains":
*code = AssertionOperatorTypeNotContains
case "eval":
*code = AssertionOperatorTypeEval
default:
return fmt.Errorf("unknown AssertionOperatorType code `%s`", s)
}
return nil
}
func (code AssertionOperatorType) String() string {
return code.Code()
}
func (code AssertionOperatorType) Code() string {
switch code {
case AssertionOperatorTypeEquals:
return "equals"
case AssertionOperatorTypeNotEquals:
return "notEquals"
case AssertionOperatorTypeIn:
return "in"
case AssertionOperatorTypeNotIn:
return "notIn"
case AssertionOperatorTypeGreaterThan:
return "greaterThan"
case AssertionOperatorTypeLessThan:
return "lessThan"
case AssertionOperatorTypeEmpty:
return "empty"
case AssertionOperatorTypeNotEmpty:
return "notEmpty"
case AssertionOperatorTypeContains:
return "contains"
case AssertionOperatorTypeNotContains:
return "notContains"
case AssertionOperatorTypeEval:
return "eval"
}
return "<unknown>"
}
func (code AssertionOperatorType) Display() string {
switch code {
case AssertionOperatorTypeEquals:
return "equals"
case AssertionOperatorTypeNotEquals:
return "notEquals"
case AssertionOperatorTypeIn:
return "in"
case AssertionOperatorTypeNotIn:
return "notIn"
case AssertionOperatorTypeGreaterThan:
return "greaterThan"
case AssertionOperatorTypeLessThan:
return "lessThan"
case AssertionOperatorTypeEmpty:
return "empty"
case AssertionOperatorTypeNotEmpty:
return "notEmpty"
case AssertionOperatorTypeContains:
return "contains"
case AssertionOperatorTypeNotContains:
return "notContains"
case AssertionOperatorTypeEval:
return "evaluate"
}
return "<unknown>"
}
func (code AssertionOperatorType) Definition() string {
switch code {
case AssertionOperatorTypeEquals:
return "Default value. Equals comparison."
case AssertionOperatorTypeNotEquals:
return "Not equals comparison."
case AssertionOperatorTypeIn:
return "Compare value within a known set of values."
case AssertionOperatorTypeNotIn:
return "Compare value not within a known set of values."
case AssertionOperatorTypeGreaterThan:
return "Compare value to be greater than a known value."
case AssertionOperatorTypeLessThan:
return "Compare value to be less than a known value."
case AssertionOperatorTypeEmpty:
return "Compare value is empty."
case AssertionOperatorTypeNotEmpty:
return "Compare value is not empty."
case AssertionOperatorTypeContains:
return "Compare value string contains a known value."
case AssertionOperatorTypeNotContains:
return "Compare value string does not contain a known value."
case AssertionOperatorTypeEval:
return "Evaluate the FHIRPath expression as a boolean condition."
}
return "<unknown>"
}