@headspace/protos-events 1.857.0 → 1.859.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/index.mjs CHANGED
@@ -266575,6 +266575,7 @@ export const ClinicalNoteEncounter = $root.ClinicalNoteEncounter = (() => {
266575
266575
  * @property {number|Long|null} [encounterStart] ClinicalNoteEncounter encounterStart
266576
266576
  * @property {number|Long|null} [encounterEnd] ClinicalNoteEncounter encounterEnd
266577
266577
  * @property {string|null} [appointmentId] ClinicalNoteEncounter appointmentId
266578
+ * @property {Array.<ClinicalNoteCodeableConcept.$Properties>|null} [reasons] ClinicalNoteEncounter reasons
266578
266579
  * @property {Array.<Uint8Array>} [$unknowns] Unknown fields preserved while decoding
266579
266580
  */
266580
266581
 
@@ -266601,6 +266602,7 @@ export const ClinicalNoteEncounter = $root.ClinicalNoteEncounter = (() => {
266601
266602
  */
266602
266603
  function ClinicalNoteEncounter(properties) {
266603
266604
  this.cptCodes = [];
266605
+ this.reasons = [];
266604
266606
  if (properties)
266605
266607
  for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
266606
266608
  if (properties[keys[i]] != null && keys[i] !== "__proto__")
@@ -266647,6 +266649,14 @@ export const ClinicalNoteEncounter = $root.ClinicalNoteEncounter = (() => {
266647
266649
  */
266648
266650
  ClinicalNoteEncounter.prototype.appointmentId = "";
266649
266651
 
266652
+ /**
266653
+ * ClinicalNoteEncounter reasons.
266654
+ * @member {Array.<ClinicalNoteCodeableConcept.$Properties>} reasons
266655
+ * @memberof ClinicalNoteEncounter
266656
+ * @instance
266657
+ */
266658
+ ClinicalNoteEncounter.prototype.reasons = $util.emptyArray;
266659
+
266650
266660
  /**
266651
266661
  * Creates a new ClinicalNoteEncounter instance using the specified properties.
266652
266662
  * @function create
@@ -266686,6 +266696,9 @@ export const ClinicalNoteEncounter = $root.ClinicalNoteEncounter = (() => {
266686
266696
  writer.uint32(/* id 4, wireType 0 =*/32).uint64(message.encounterEnd);
266687
266697
  if (message.appointmentId != null && Object.hasOwnProperty.call(message, "appointmentId"))
266688
266698
  writer.uint32(/* id 5, wireType 2 =*/42).string(message.appointmentId);
266699
+ if (message.reasons != null && message.reasons.length)
266700
+ for (let i = 0; i < message.reasons.length; ++i)
266701
+ $root.ClinicalNoteCodeableConcept.encode(message.reasons[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim();
266689
266702
  if (message.$unknowns != null && Object.hasOwnProperty.call(message, "$unknowns"))
266690
266703
  for (let i = 0; i < message.$unknowns.length; ++i)
266691
266704
  writer.raw(message.$unknowns[i]);
@@ -266777,6 +266790,14 @@ export const ClinicalNoteEncounter = $root.ClinicalNoteEncounter = (() => {
266777
266790
  delete message.appointmentId;
266778
266791
  continue;
266779
266792
  }
266793
+ case 6: {
266794
+ if (wireType !== 2)
266795
+ break;
266796
+ if (!(message.reasons && message.reasons.length))
266797
+ message.reasons = [];
266798
+ message.reasons.push($root.ClinicalNoteCodeableConcept.decode(reader, reader.uint32(), undefined, _depth + 1));
266799
+ continue;
266800
+ }
266780
266801
  }
266781
266802
  reader.skipType(wireType, _depth, tag);
266782
266803
  $util.makeProp(message, "$unknowns", false);
@@ -266837,6 +266858,15 @@ export const ClinicalNoteEncounter = $root.ClinicalNoteEncounter = (() => {
266837
266858
  if (message.appointmentId != null && message.hasOwnProperty("appointmentId"))
266838
266859
  if (!$util.isString(message.appointmentId))
266839
266860
  return "appointmentId: string expected";
266861
+ if (message.reasons != null && message.hasOwnProperty("reasons")) {
266862
+ if (!Array.isArray(message.reasons))
266863
+ return "reasons: array expected";
266864
+ for (let i = 0; i < message.reasons.length; ++i) {
266865
+ let error = $root.ClinicalNoteCodeableConcept.verify(message.reasons[i], _depth + 1);
266866
+ if (error)
266867
+ return "reasons." + error;
266868
+ }
266869
+ }
266840
266870
  return null;
266841
266871
  };
266842
266872
 
@@ -266889,6 +266919,16 @@ export const ClinicalNoteEncounter = $root.ClinicalNoteEncounter = (() => {
266889
266919
  if (object.appointmentId != null)
266890
266920
  if (typeof object.appointmentId !== "string" || object.appointmentId.length)
266891
266921
  message.appointmentId = String(object.appointmentId);
266922
+ if (object.reasons) {
266923
+ if (!Array.isArray(object.reasons))
266924
+ throw TypeError(".ClinicalNoteEncounter.reasons: array expected");
266925
+ message.reasons = Array(object.reasons.length);
266926
+ for (let i = 0; i < object.reasons.length; ++i) {
266927
+ if (typeof object.reasons[i] !== "object")
266928
+ throw TypeError(".ClinicalNoteEncounter.reasons: object expected");
266929
+ message.reasons[i] = $root.ClinicalNoteCodeableConcept.fromObject(object.reasons[i], _depth + 1);
266930
+ }
266931
+ }
266892
266932
  return message;
266893
266933
  };
266894
266934
 
@@ -266905,8 +266945,10 @@ export const ClinicalNoteEncounter = $root.ClinicalNoteEncounter = (() => {
266905
266945
  if (!options)
266906
266946
  options = {};
266907
266947
  let object = {};
266908
- if (options.arrays || options.defaults)
266948
+ if (options.arrays || options.defaults) {
266909
266949
  object.cptCodes = [];
266950
+ object.reasons = [];
266951
+ }
266910
266952
  if (options.defaults) {
266911
266953
  object.encounterStatus = "";
266912
266954
  if ($util.Long) {
@@ -266944,6 +266986,11 @@ export const ClinicalNoteEncounter = $root.ClinicalNoteEncounter = (() => {
266944
266986
  object.encounterEnd = options.longs === String ? $util.Long.prototype.toString.call(message.encounterEnd) : options.longs === Number ? new $util.LongBits(message.encounterEnd.low >>> 0, message.encounterEnd.high >>> 0).toNumber(true) : message.encounterEnd;
266945
266987
  if (message.appointmentId != null && message.hasOwnProperty("appointmentId"))
266946
266988
  object.appointmentId = message.appointmentId;
266989
+ if (message.reasons && message.reasons.length) {
266990
+ object.reasons = Array(message.reasons.length);
266991
+ for (let j = 0; j < message.reasons.length; ++j)
266992
+ object.reasons[j] = $root.ClinicalNoteCodeableConcept.toObject(message.reasons[j], options);
266993
+ }
266947
266994
  return object;
266948
266995
  };
266949
266996
 
@@ -268101,52 +268148,39 @@ export const ClinicalNoteMedication = $root.ClinicalNoteMedication = (() => {
268101
268148
  return ClinicalNoteMedication;
268102
268149
  })();
268103
268150
 
268104
- export const GingerClinicalNotePayload = $root.GingerClinicalNotePayload = (() => {
268151
+ export const ClinicalNoteCoding = $root.ClinicalNoteCoding = (() => {
268105
268152
 
268106
268153
  /**
268107
- * Properties of a GingerClinicalNotePayload.
268108
- * @typedef {Object} GingerClinicalNotePayload.$Properties
268109
- * @property {string|null} [noteId] GingerClinicalNotePayload noteId
268110
- * @property {string|null} [hsUserId] GingerClinicalNotePayload hsUserId
268111
- * @property {GingerClinicalNoteType|null} [noteType] GingerClinicalNotePayload noteType
268112
- * @property {ClinicalNotePatient.$Properties|null} [patient] GingerClinicalNotePayload patient
268113
- * @property {ClinicalNotePractitioner.$Properties|null} [practitioner] GingerClinicalNotePayload practitioner
268114
- * @property {ClinicalNoteOrganization.$Properties|null} [organization] GingerClinicalNotePayload organization
268115
- * @property {ClinicalNoteEncounter.$Properties|null} [encounter] GingerClinicalNotePayload encounter
268116
- * @property {string|null} [content] GingerClinicalNotePayload content
268117
- * @property {Array.<string>|null} [icd10Codes] GingerClinicalNotePayload icd10Codes
268118
- * @property {Array.<string>|null} [ds4pCodes] GingerClinicalNotePayload ds4pCodes
268119
- * @property {Array.<ClinicalNoteAllergy.$Properties>|null} [allergies] GingerClinicalNotePayload allergies
268120
- * @property {Array.<ClinicalNoteMedication.$Properties>|null} [medications] GingerClinicalNotePayload medications
268154
+ * Properties of a ClinicalNoteCoding.
268155
+ * @typedef {Object} ClinicalNoteCoding.$Properties
268156
+ * @property {string|null} [system] ClinicalNoteCoding system
268157
+ * @property {string|null} [code] ClinicalNoteCoding code
268158
+ * @property {string|null} [display] ClinicalNoteCoding display
268121
268159
  * @property {Array.<Uint8Array>} [$unknowns] Unknown fields preserved while decoding
268122
268160
  */
268123
268161
 
268124
268162
  /**
268125
- * Properties of a GingerClinicalNotePayload.
268126
- * @name IGingerClinicalNotePayload
268127
- * @interface IGingerClinicalNotePayload
268128
- * @augments GingerClinicalNotePayload.$Properties
268129
- * @deprecated Use GingerClinicalNotePayload.$Properties instead.
268163
+ * Properties of a ClinicalNoteCoding.
268164
+ * @name IClinicalNoteCoding
268165
+ * @interface IClinicalNoteCoding
268166
+ * @augments ClinicalNoteCoding.$Properties
268167
+ * @deprecated Use ClinicalNoteCoding.$Properties instead.
268130
268168
  */
268131
268169
 
268132
268170
  /**
268133
- * Shape of a GingerClinicalNotePayload.
268134
- * @typedef {GingerClinicalNotePayload.$Properties} GingerClinicalNotePayload.$Shape
268171
+ * Shape of a ClinicalNoteCoding.
268172
+ * @typedef {ClinicalNoteCoding.$Properties} ClinicalNoteCoding.$Shape
268135
268173
  */
268136
268174
 
268137
268175
  /**
268138
- * Constructs a new GingerClinicalNotePayload.
268139
- * @name GingerClinicalNotePayload
268140
- * @classdesc Represents a GingerClinicalNotePayload.
268176
+ * Constructs a new ClinicalNoteCoding.
268177
+ * @name ClinicalNoteCoding
268178
+ * @classdesc Represents a ClinicalNoteCoding.
268141
268179
  * @constructor
268142
- * @param {GingerClinicalNotePayload.$Properties=} [properties] Properties to set
268180
+ * @param {ClinicalNoteCoding.$Properties=} [properties] Properties to set
268143
268181
  * @property {Array.<Uint8Array>} [$unknowns] Unknown fields preserved while decoding
268144
268182
  */
268145
- function GingerClinicalNotePayload(properties) {
268146
- this.icd10Codes = [];
268147
- this.ds4pCodes = [];
268148
- this.allergies = [];
268149
- this.medications = [];
268183
+ function ClinicalNoteCoding(properties) {
268150
268184
  if (properties)
268151
268185
  for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
268152
268186
  if (properties[keys[i]] != null && keys[i] !== "__proto__")
@@ -268154,157 +268188,63 @@ export const GingerClinicalNotePayload = $root.GingerClinicalNotePayload = (() =
268154
268188
  }
268155
268189
 
268156
268190
  /**
268157
- * GingerClinicalNotePayload noteId.
268158
- * @member {string} noteId
268159
- * @memberof GingerClinicalNotePayload
268160
- * @instance
268161
- */
268162
- GingerClinicalNotePayload.prototype.noteId = "";
268163
-
268164
- /**
268165
- * GingerClinicalNotePayload hsUserId.
268166
- * @member {string} hsUserId
268167
- * @memberof GingerClinicalNotePayload
268168
- * @instance
268169
- */
268170
- GingerClinicalNotePayload.prototype.hsUserId = "";
268171
-
268172
- /**
268173
- * GingerClinicalNotePayload noteType.
268174
- * @member {GingerClinicalNoteType} noteType
268175
- * @memberof GingerClinicalNotePayload
268176
- * @instance
268177
- */
268178
- GingerClinicalNotePayload.prototype.noteType = 0;
268179
-
268180
- /**
268181
- * GingerClinicalNotePayload patient.
268182
- * @member {ClinicalNotePatient.$Properties|null|undefined} patient
268183
- * @memberof GingerClinicalNotePayload
268184
- * @instance
268185
- */
268186
- GingerClinicalNotePayload.prototype.patient = null;
268187
-
268188
- /**
268189
- * GingerClinicalNotePayload practitioner.
268190
- * @member {ClinicalNotePractitioner.$Properties|null|undefined} practitioner
268191
- * @memberof GingerClinicalNotePayload
268192
- * @instance
268193
- */
268194
- GingerClinicalNotePayload.prototype.practitioner = null;
268195
-
268196
- /**
268197
- * GingerClinicalNotePayload organization.
268198
- * @member {ClinicalNoteOrganization.$Properties|null|undefined} organization
268199
- * @memberof GingerClinicalNotePayload
268200
- * @instance
268201
- */
268202
- GingerClinicalNotePayload.prototype.organization = null;
268203
-
268204
- /**
268205
- * GingerClinicalNotePayload encounter.
268206
- * @member {ClinicalNoteEncounter.$Properties|null|undefined} encounter
268207
- * @memberof GingerClinicalNotePayload
268208
- * @instance
268209
- */
268210
- GingerClinicalNotePayload.prototype.encounter = null;
268211
-
268212
- /**
268213
- * GingerClinicalNotePayload content.
268214
- * @member {string} content
268215
- * @memberof GingerClinicalNotePayload
268216
- * @instance
268217
- */
268218
- GingerClinicalNotePayload.prototype.content = "";
268219
-
268220
- /**
268221
- * GingerClinicalNotePayload icd10Codes.
268222
- * @member {Array.<string>} icd10Codes
268223
- * @memberof GingerClinicalNotePayload
268224
- * @instance
268225
- */
268226
- GingerClinicalNotePayload.prototype.icd10Codes = $util.emptyArray;
268227
-
268228
- /**
268229
- * GingerClinicalNotePayload ds4pCodes.
268230
- * @member {Array.<string>} ds4pCodes
268231
- * @memberof GingerClinicalNotePayload
268191
+ * ClinicalNoteCoding system.
268192
+ * @member {string} system
268193
+ * @memberof ClinicalNoteCoding
268232
268194
  * @instance
268233
268195
  */
268234
- GingerClinicalNotePayload.prototype.ds4pCodes = $util.emptyArray;
268196
+ ClinicalNoteCoding.prototype.system = "";
268235
268197
 
268236
268198
  /**
268237
- * GingerClinicalNotePayload allergies.
268238
- * @member {Array.<ClinicalNoteAllergy.$Properties>} allergies
268239
- * @memberof GingerClinicalNotePayload
268199
+ * ClinicalNoteCoding code.
268200
+ * @member {string} code
268201
+ * @memberof ClinicalNoteCoding
268240
268202
  * @instance
268241
268203
  */
268242
- GingerClinicalNotePayload.prototype.allergies = $util.emptyArray;
268204
+ ClinicalNoteCoding.prototype.code = "";
268243
268205
 
268244
268206
  /**
268245
- * GingerClinicalNotePayload medications.
268246
- * @member {Array.<ClinicalNoteMedication.$Properties>} medications
268247
- * @memberof GingerClinicalNotePayload
268207
+ * ClinicalNoteCoding display.
268208
+ * @member {string} display
268209
+ * @memberof ClinicalNoteCoding
268248
268210
  * @instance
268249
268211
  */
268250
- GingerClinicalNotePayload.prototype.medications = $util.emptyArray;
268212
+ ClinicalNoteCoding.prototype.display = "";
268251
268213
 
268252
268214
  /**
268253
- * Creates a new GingerClinicalNotePayload instance using the specified properties.
268215
+ * Creates a new ClinicalNoteCoding instance using the specified properties.
268254
268216
  * @function create
268255
- * @memberof GingerClinicalNotePayload
268217
+ * @memberof ClinicalNoteCoding
268256
268218
  * @static
268257
- * @param {GingerClinicalNotePayload.$Properties=} [properties] Properties to set
268258
- * @returns {GingerClinicalNotePayload} GingerClinicalNotePayload instance
268219
+ * @param {ClinicalNoteCoding.$Properties=} [properties] Properties to set
268220
+ * @returns {ClinicalNoteCoding} ClinicalNoteCoding instance
268259
268221
  * @type {{
268260
- * (properties: GingerClinicalNotePayload.$Shape): GingerClinicalNotePayload & GingerClinicalNotePayload.$Shape;
268261
- * (properties?: GingerClinicalNotePayload.$Properties): GingerClinicalNotePayload;
268222
+ * (properties: ClinicalNoteCoding.$Shape): ClinicalNoteCoding & ClinicalNoteCoding.$Shape;
268223
+ * (properties?: ClinicalNoteCoding.$Properties): ClinicalNoteCoding;
268262
268224
  * }}
268263
268225
  */
268264
- GingerClinicalNotePayload.create = function create(properties) {
268265
- return new GingerClinicalNotePayload(properties);
268226
+ ClinicalNoteCoding.create = function create(properties) {
268227
+ return new ClinicalNoteCoding(properties);
268266
268228
  };
268267
268229
 
268268
268230
  /**
268269
- * Encodes the specified GingerClinicalNotePayload message. Does not implicitly {@link GingerClinicalNotePayload.verify|verify} messages.
268231
+ * Encodes the specified ClinicalNoteCoding message. Does not implicitly {@link ClinicalNoteCoding.verify|verify} messages.
268270
268232
  * @function encode
268271
- * @memberof GingerClinicalNotePayload
268233
+ * @memberof ClinicalNoteCoding
268272
268234
  * @static
268273
- * @param {GingerClinicalNotePayload.$Properties} message GingerClinicalNotePayload message or plain object to encode
268235
+ * @param {ClinicalNoteCoding.$Properties} message ClinicalNoteCoding message or plain object to encode
268274
268236
  * @param {$protobuf.Writer} [writer] Writer to encode to
268275
268237
  * @returns {$protobuf.Writer} Writer
268276
268238
  */
268277
- GingerClinicalNotePayload.encode = function encode(message, writer) {
268239
+ ClinicalNoteCoding.encode = function encode(message, writer) {
268278
268240
  if (!writer)
268279
268241
  writer = $Writer.create();
268280
- if (message.noteId != null && Object.hasOwnProperty.call(message, "noteId"))
268281
- writer.uint32(/* id 1, wireType 2 =*/10).string(message.noteId);
268282
- if (message.hsUserId != null && Object.hasOwnProperty.call(message, "hsUserId"))
268283
- writer.uint32(/* id 2, wireType 2 =*/18).string(message.hsUserId);
268284
- if (message.noteType != null && Object.hasOwnProperty.call(message, "noteType"))
268285
- writer.uint32(/* id 3, wireType 0 =*/24).int32(message.noteType);
268286
- if (message.patient != null && Object.hasOwnProperty.call(message, "patient"))
268287
- $root.ClinicalNotePatient.encode(message.patient, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim();
268288
- if (message.practitioner != null && Object.hasOwnProperty.call(message, "practitioner"))
268289
- $root.ClinicalNotePractitioner.encode(message.practitioner, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim();
268290
- if (message.organization != null && Object.hasOwnProperty.call(message, "organization"))
268291
- $root.ClinicalNoteOrganization.encode(message.organization, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim();
268292
- if (message.encounter != null && Object.hasOwnProperty.call(message, "encounter"))
268293
- $root.ClinicalNoteEncounter.encode(message.encounter, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim();
268294
- if (message.content != null && Object.hasOwnProperty.call(message, "content"))
268295
- writer.uint32(/* id 8, wireType 2 =*/66).string(message.content);
268296
- if (message.icd10Codes != null && message.icd10Codes.length)
268297
- for (let i = 0; i < message.icd10Codes.length; ++i)
268298
- writer.uint32(/* id 9, wireType 2 =*/74).string(message.icd10Codes[i]);
268299
- if (message.ds4pCodes != null && message.ds4pCodes.length)
268300
- for (let i = 0; i < message.ds4pCodes.length; ++i)
268301
- writer.uint32(/* id 10, wireType 2 =*/82).string(message.ds4pCodes[i]);
268302
- if (message.allergies != null && message.allergies.length)
268303
- for (let i = 0; i < message.allergies.length; ++i)
268304
- $root.ClinicalNoteAllergy.encode(message.allergies[i], writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim();
268305
- if (message.medications != null && message.medications.length)
268306
- for (let i = 0; i < message.medications.length; ++i)
268307
- $root.ClinicalNoteMedication.encode(message.medications[i], writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim();
268242
+ if (message.system != null && Object.hasOwnProperty.call(message, "system"))
268243
+ writer.uint32(/* id 1, wireType 2 =*/10).string(message.system);
268244
+ if (message.code != null && Object.hasOwnProperty.call(message, "code"))
268245
+ writer.uint32(/* id 2, wireType 2 =*/18).string(message.code);
268246
+ if (message.display != null && Object.hasOwnProperty.call(message, "display"))
268247
+ writer.uint32(/* id 3, wireType 2 =*/26).string(message.display);
268308
268248
  if (message.$unknowns != null && Object.hasOwnProperty.call(message, "$unknowns"))
268309
268249
  for (let i = 0; i < message.$unknowns.length; ++i)
268310
268250
  writer.raw(message.$unknowns[i]);
@@ -268312,37 +268252,37 @@ export const GingerClinicalNotePayload = $root.GingerClinicalNotePayload = (() =
268312
268252
  };
268313
268253
 
268314
268254
  /**
268315
- * Encodes the specified GingerClinicalNotePayload message, length delimited. Does not implicitly {@link GingerClinicalNotePayload.verify|verify} messages.
268255
+ * Encodes the specified ClinicalNoteCoding message, length delimited. Does not implicitly {@link ClinicalNoteCoding.verify|verify} messages.
268316
268256
  * @function encodeDelimited
268317
- * @memberof GingerClinicalNotePayload
268257
+ * @memberof ClinicalNoteCoding
268318
268258
  * @static
268319
- * @param {GingerClinicalNotePayload.$Properties} message GingerClinicalNotePayload message or plain object to encode
268259
+ * @param {ClinicalNoteCoding.$Properties} message ClinicalNoteCoding message or plain object to encode
268320
268260
  * @param {$protobuf.Writer} [writer] Writer to encode to
268321
268261
  * @returns {$protobuf.Writer} Writer
268322
268262
  */
268323
- GingerClinicalNotePayload.encodeDelimited = function encodeDelimited(message, writer) {
268263
+ ClinicalNoteCoding.encodeDelimited = function encodeDelimited(message, writer) {
268324
268264
  return this.encode(message, writer).ldelim();
268325
268265
  };
268326
268266
 
268327
268267
  /**
268328
- * Decodes a GingerClinicalNotePayload message from the specified reader or buffer.
268268
+ * Decodes a ClinicalNoteCoding message from the specified reader or buffer.
268329
268269
  * @function decode
268330
- * @memberof GingerClinicalNotePayload
268270
+ * @memberof ClinicalNoteCoding
268331
268271
  * @static
268332
268272
  * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
268333
268273
  * @param {number} [length] Message length if known beforehand
268334
- * @returns {GingerClinicalNotePayload & GingerClinicalNotePayload.$Shape} GingerClinicalNotePayload
268274
+ * @returns {ClinicalNoteCoding & ClinicalNoteCoding.$Shape} ClinicalNoteCoding
268335
268275
  * @throws {Error} If the payload is not a reader or valid buffer
268336
268276
  * @throws {$protobuf.util.ProtocolError} If required fields are missing
268337
268277
  */
268338
- GingerClinicalNotePayload.decode = function decode(reader, length, _end, _depth, _target) {
268278
+ ClinicalNoteCoding.decode = function decode(reader, length, _end, _depth, _target) {
268339
268279
  if (!(reader instanceof $Reader))
268340
268280
  reader = $Reader.create(reader);
268341
268281
  if (_depth === undefined)
268342
268282
  _depth = 0;
268343
268283
  if (_depth > $Reader.recursionLimit)
268344
268284
  throw Error("max depth exceeded");
268345
- let end = length === undefined ? reader.len : reader.pos + length, message = _target || new $root.GingerClinicalNotePayload(), value;
268285
+ let end = length === undefined ? reader.len : reader.pos + length, message = _target || new $root.ClinicalNoteCoding(), value;
268346
268286
  while (reader.pos < end) {
268347
268287
  let start = reader.pos;
268348
268288
  let tag = reader.tag();
@@ -268356,94 +268296,1749 @@ export const GingerClinicalNotePayload = $root.GingerClinicalNotePayload = (() =
268356
268296
  if (wireType !== 2)
268357
268297
  break;
268358
268298
  if ((value = reader.string()).length)
268359
- message.noteId = value;
268299
+ message.system = value;
268360
268300
  else
268361
- delete message.noteId;
268301
+ delete message.system;
268362
268302
  continue;
268363
268303
  }
268364
268304
  case 2: {
268365
268305
  if (wireType !== 2)
268366
268306
  break;
268367
268307
  if ((value = reader.string()).length)
268368
- message.hsUserId = value;
268308
+ message.code = value;
268369
268309
  else
268370
- delete message.hsUserId;
268310
+ delete message.code;
268371
268311
  continue;
268372
268312
  }
268373
268313
  case 3: {
268374
- if (wireType !== 0)
268375
- break;
268376
- if (value = reader.int32())
268377
- message.noteType = value;
268378
- else
268379
- delete message.noteType;
268380
- continue;
268381
- }
268382
- case 4: {
268383
- if (wireType !== 2)
268384
- break;
268385
- message.patient = $root.ClinicalNotePatient.decode(reader, reader.uint32(), undefined, _depth + 1, message.patient);
268386
- continue;
268387
- }
268388
- case 5: {
268389
- if (wireType !== 2)
268390
- break;
268391
- message.practitioner = $root.ClinicalNotePractitioner.decode(reader, reader.uint32(), undefined, _depth + 1, message.practitioner);
268392
- continue;
268393
- }
268394
- case 6: {
268395
- if (wireType !== 2)
268396
- break;
268397
- message.organization = $root.ClinicalNoteOrganization.decode(reader, reader.uint32(), undefined, _depth + 1, message.organization);
268398
- continue;
268399
- }
268400
- case 7: {
268401
- if (wireType !== 2)
268402
- break;
268403
- message.encounter = $root.ClinicalNoteEncounter.decode(reader, reader.uint32(), undefined, _depth + 1, message.encounter);
268404
- continue;
268405
- }
268406
- case 8: {
268407
268314
  if (wireType !== 2)
268408
268315
  break;
268409
268316
  if ((value = reader.string()).length)
268410
- message.content = value;
268317
+ message.display = value;
268411
268318
  else
268412
- delete message.content;
268413
- continue;
268414
- }
268415
- case 9: {
268416
- if (wireType !== 2)
268417
- break;
268418
- if (!(message.icd10Codes && message.icd10Codes.length))
268419
- message.icd10Codes = [];
268420
- message.icd10Codes.push(reader.string());
268421
- continue;
268422
- }
268423
- case 10: {
268424
- if (wireType !== 2)
268425
- break;
268426
- if (!(message.ds4pCodes && message.ds4pCodes.length))
268427
- message.ds4pCodes = [];
268428
- message.ds4pCodes.push(reader.string());
268429
- continue;
268430
- }
268431
- case 11: {
268432
- if (wireType !== 2)
268433
- break;
268434
- if (!(message.allergies && message.allergies.length))
268435
- message.allergies = [];
268436
- message.allergies.push($root.ClinicalNoteAllergy.decode(reader, reader.uint32(), undefined, _depth + 1));
268319
+ delete message.display;
268437
268320
  continue;
268438
268321
  }
268439
- case 12: {
268440
- if (wireType !== 2)
268441
- break;
268442
- if (!(message.medications && message.medications.length))
268443
- message.medications = [];
268322
+ }
268323
+ reader.skipType(wireType, _depth, tag);
268324
+ $util.makeProp(message, "$unknowns", false);
268325
+ (message.$unknowns || (message.$unknowns = [])).push(reader.raw(start, reader.pos));
268326
+ }
268327
+ if (_end !== undefined)
268328
+ throw Error("missing end group");
268329
+ return message;
268330
+ };
268331
+
268332
+ /**
268333
+ * Decodes a ClinicalNoteCoding message from the specified reader or buffer, length delimited.
268334
+ * @function decodeDelimited
268335
+ * @memberof ClinicalNoteCoding
268336
+ * @static
268337
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
268338
+ * @returns {ClinicalNoteCoding & ClinicalNoteCoding.$Shape} ClinicalNoteCoding
268339
+ * @throws {Error} If the payload is not a reader or valid buffer
268340
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
268341
+ */
268342
+ ClinicalNoteCoding.decodeDelimited = function decodeDelimited(reader) {
268343
+ if (!(reader instanceof $Reader))
268344
+ reader = new $Reader(reader);
268345
+ return this.decode(reader, reader.uint32());
268346
+ };
268347
+
268348
+ /**
268349
+ * Verifies a ClinicalNoteCoding message.
268350
+ * @function verify
268351
+ * @memberof ClinicalNoteCoding
268352
+ * @static
268353
+ * @param {Object.<string,*>} message Plain object to verify
268354
+ * @returns {string|null} `null` if valid, otherwise the reason why it is not
268355
+ */
268356
+ ClinicalNoteCoding.verify = function verify(message, _depth) {
268357
+ if (typeof message !== "object" || message === null)
268358
+ return "object expected";
268359
+ if (_depth === undefined)
268360
+ _depth = 0;
268361
+ if (_depth > $util.recursionLimit)
268362
+ return "max depth exceeded";
268363
+ if (message.system != null && message.hasOwnProperty("system"))
268364
+ if (!$util.isString(message.system))
268365
+ return "system: string expected";
268366
+ if (message.code != null && message.hasOwnProperty("code"))
268367
+ if (!$util.isString(message.code))
268368
+ return "code: string expected";
268369
+ if (message.display != null && message.hasOwnProperty("display"))
268370
+ if (!$util.isString(message.display))
268371
+ return "display: string expected";
268372
+ return null;
268373
+ };
268374
+
268375
+ /**
268376
+ * Creates a ClinicalNoteCoding message from a plain object. Also converts values to their respective internal types.
268377
+ * @function fromObject
268378
+ * @memberof ClinicalNoteCoding
268379
+ * @static
268380
+ * @param {Object.<string,*>} object Plain object
268381
+ * @returns {ClinicalNoteCoding} ClinicalNoteCoding
268382
+ */
268383
+ ClinicalNoteCoding.fromObject = function fromObject(object, _depth) {
268384
+ if (object instanceof $root.ClinicalNoteCoding)
268385
+ return object;
268386
+ if (_depth === undefined)
268387
+ _depth = 0;
268388
+ if (_depth > $util.recursionLimit)
268389
+ throw Error("max depth exceeded");
268390
+ let message = new $root.ClinicalNoteCoding();
268391
+ if (object.system != null)
268392
+ if (typeof object.system !== "string" || object.system.length)
268393
+ message.system = String(object.system);
268394
+ if (object.code != null)
268395
+ if (typeof object.code !== "string" || object.code.length)
268396
+ message.code = String(object.code);
268397
+ if (object.display != null)
268398
+ if (typeof object.display !== "string" || object.display.length)
268399
+ message.display = String(object.display);
268400
+ return message;
268401
+ };
268402
+
268403
+ /**
268404
+ * Creates a plain object from a ClinicalNoteCoding message. Also converts values to other types if specified.
268405
+ * @function toObject
268406
+ * @memberof ClinicalNoteCoding
268407
+ * @static
268408
+ * @param {ClinicalNoteCoding} message ClinicalNoteCoding
268409
+ * @param {$protobuf.IConversionOptions} [options] Conversion options
268410
+ * @returns {Object.<string,*>} Plain object
268411
+ */
268412
+ ClinicalNoteCoding.toObject = function toObject(message, options) {
268413
+ if (!options)
268414
+ options = {};
268415
+ let object = {};
268416
+ if (options.defaults) {
268417
+ object.system = "";
268418
+ object.code = "";
268419
+ object.display = "";
268420
+ }
268421
+ if (message.system != null && message.hasOwnProperty("system"))
268422
+ object.system = message.system;
268423
+ if (message.code != null && message.hasOwnProperty("code"))
268424
+ object.code = message.code;
268425
+ if (message.display != null && message.hasOwnProperty("display"))
268426
+ object.display = message.display;
268427
+ return object;
268428
+ };
268429
+
268430
+ /**
268431
+ * Converts this ClinicalNoteCoding to JSON.
268432
+ * @function toJSON
268433
+ * @memberof ClinicalNoteCoding
268434
+ * @instance
268435
+ * @returns {Object.<string,*>} JSON object
268436
+ */
268437
+ ClinicalNoteCoding.prototype.toJSON = function toJSON() {
268438
+ return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
268439
+ };
268440
+
268441
+ /**
268442
+ * Gets the type url for ClinicalNoteCoding
268443
+ * @function getTypeUrl
268444
+ * @memberof ClinicalNoteCoding
268445
+ * @static
268446
+ * @param {string} [prefix] Custom type url prefix, defaults to `"type.googleapis.com"`
268447
+ * @returns {string} The type url
268448
+ */
268449
+ ClinicalNoteCoding.getTypeUrl = function getTypeUrl(prefix) {
268450
+ if (prefix === undefined)
268451
+ prefix = "type.googleapis.com";
268452
+ return prefix + "/ClinicalNoteCoding";
268453
+ };
268454
+
268455
+ return ClinicalNoteCoding;
268456
+ })();
268457
+
268458
+ export const ClinicalNoteCodeableConcept = $root.ClinicalNoteCodeableConcept = (() => {
268459
+
268460
+ /**
268461
+ * Properties of a ClinicalNoteCodeableConcept.
268462
+ * @typedef {Object} ClinicalNoteCodeableConcept.$Properties
268463
+ * @property {Array.<ClinicalNoteCoding.$Properties>|null} [codings] ClinicalNoteCodeableConcept codings
268464
+ * @property {string|null} [text] ClinicalNoteCodeableConcept text
268465
+ * @property {Array.<Uint8Array>} [$unknowns] Unknown fields preserved while decoding
268466
+ */
268467
+
268468
+ /**
268469
+ * Properties of a ClinicalNoteCodeableConcept.
268470
+ * @name IClinicalNoteCodeableConcept
268471
+ * @interface IClinicalNoteCodeableConcept
268472
+ * @augments ClinicalNoteCodeableConcept.$Properties
268473
+ * @deprecated Use ClinicalNoteCodeableConcept.$Properties instead.
268474
+ */
268475
+
268476
+ /**
268477
+ * Shape of a ClinicalNoteCodeableConcept.
268478
+ * @typedef {ClinicalNoteCodeableConcept.$Properties} ClinicalNoteCodeableConcept.$Shape
268479
+ */
268480
+
268481
+ /**
268482
+ * Constructs a new ClinicalNoteCodeableConcept.
268483
+ * @name ClinicalNoteCodeableConcept
268484
+ * @classdesc Represents a ClinicalNoteCodeableConcept.
268485
+ * @constructor
268486
+ * @param {ClinicalNoteCodeableConcept.$Properties=} [properties] Properties to set
268487
+ * @property {Array.<Uint8Array>} [$unknowns] Unknown fields preserved while decoding
268488
+ */
268489
+ function ClinicalNoteCodeableConcept(properties) {
268490
+ this.codings = [];
268491
+ if (properties)
268492
+ for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
268493
+ if (properties[keys[i]] != null && keys[i] !== "__proto__")
268494
+ this[keys[i]] = properties[keys[i]];
268495
+ }
268496
+
268497
+ /**
268498
+ * ClinicalNoteCodeableConcept codings.
268499
+ * @member {Array.<ClinicalNoteCoding.$Properties>} codings
268500
+ * @memberof ClinicalNoteCodeableConcept
268501
+ * @instance
268502
+ */
268503
+ ClinicalNoteCodeableConcept.prototype.codings = $util.emptyArray;
268504
+
268505
+ /**
268506
+ * ClinicalNoteCodeableConcept text.
268507
+ * @member {string} text
268508
+ * @memberof ClinicalNoteCodeableConcept
268509
+ * @instance
268510
+ */
268511
+ ClinicalNoteCodeableConcept.prototype.text = "";
268512
+
268513
+ /**
268514
+ * Creates a new ClinicalNoteCodeableConcept instance using the specified properties.
268515
+ * @function create
268516
+ * @memberof ClinicalNoteCodeableConcept
268517
+ * @static
268518
+ * @param {ClinicalNoteCodeableConcept.$Properties=} [properties] Properties to set
268519
+ * @returns {ClinicalNoteCodeableConcept} ClinicalNoteCodeableConcept instance
268520
+ * @type {{
268521
+ * (properties: ClinicalNoteCodeableConcept.$Shape): ClinicalNoteCodeableConcept & ClinicalNoteCodeableConcept.$Shape;
268522
+ * (properties?: ClinicalNoteCodeableConcept.$Properties): ClinicalNoteCodeableConcept;
268523
+ * }}
268524
+ */
268525
+ ClinicalNoteCodeableConcept.create = function create(properties) {
268526
+ return new ClinicalNoteCodeableConcept(properties);
268527
+ };
268528
+
268529
+ /**
268530
+ * Encodes the specified ClinicalNoteCodeableConcept message. Does not implicitly {@link ClinicalNoteCodeableConcept.verify|verify} messages.
268531
+ * @function encode
268532
+ * @memberof ClinicalNoteCodeableConcept
268533
+ * @static
268534
+ * @param {ClinicalNoteCodeableConcept.$Properties} message ClinicalNoteCodeableConcept message or plain object to encode
268535
+ * @param {$protobuf.Writer} [writer] Writer to encode to
268536
+ * @returns {$protobuf.Writer} Writer
268537
+ */
268538
+ ClinicalNoteCodeableConcept.encode = function encode(message, writer) {
268539
+ if (!writer)
268540
+ writer = $Writer.create();
268541
+ if (message.codings != null && message.codings.length)
268542
+ for (let i = 0; i < message.codings.length; ++i)
268543
+ $root.ClinicalNoteCoding.encode(message.codings[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
268544
+ if (message.text != null && Object.hasOwnProperty.call(message, "text"))
268545
+ writer.uint32(/* id 2, wireType 2 =*/18).string(message.text);
268546
+ if (message.$unknowns != null && Object.hasOwnProperty.call(message, "$unknowns"))
268547
+ for (let i = 0; i < message.$unknowns.length; ++i)
268548
+ writer.raw(message.$unknowns[i]);
268549
+ return writer;
268550
+ };
268551
+
268552
+ /**
268553
+ * Encodes the specified ClinicalNoteCodeableConcept message, length delimited. Does not implicitly {@link ClinicalNoteCodeableConcept.verify|verify} messages.
268554
+ * @function encodeDelimited
268555
+ * @memberof ClinicalNoteCodeableConcept
268556
+ * @static
268557
+ * @param {ClinicalNoteCodeableConcept.$Properties} message ClinicalNoteCodeableConcept message or plain object to encode
268558
+ * @param {$protobuf.Writer} [writer] Writer to encode to
268559
+ * @returns {$protobuf.Writer} Writer
268560
+ */
268561
+ ClinicalNoteCodeableConcept.encodeDelimited = function encodeDelimited(message, writer) {
268562
+ return this.encode(message, writer).ldelim();
268563
+ };
268564
+
268565
+ /**
268566
+ * Decodes a ClinicalNoteCodeableConcept message from the specified reader or buffer.
268567
+ * @function decode
268568
+ * @memberof ClinicalNoteCodeableConcept
268569
+ * @static
268570
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
268571
+ * @param {number} [length] Message length if known beforehand
268572
+ * @returns {ClinicalNoteCodeableConcept & ClinicalNoteCodeableConcept.$Shape} ClinicalNoteCodeableConcept
268573
+ * @throws {Error} If the payload is not a reader or valid buffer
268574
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
268575
+ */
268576
+ ClinicalNoteCodeableConcept.decode = function decode(reader, length, _end, _depth, _target) {
268577
+ if (!(reader instanceof $Reader))
268578
+ reader = $Reader.create(reader);
268579
+ if (_depth === undefined)
268580
+ _depth = 0;
268581
+ if (_depth > $Reader.recursionLimit)
268582
+ throw Error("max depth exceeded");
268583
+ let end = length === undefined ? reader.len : reader.pos + length, message = _target || new $root.ClinicalNoteCodeableConcept(), value;
268584
+ while (reader.pos < end) {
268585
+ let start = reader.pos;
268586
+ let tag = reader.tag();
268587
+ if (tag === _end) {
268588
+ _end = undefined;
268589
+ break;
268590
+ }
268591
+ let wireType = tag & 7;
268592
+ switch (tag >>>= 3) {
268593
+ case 1: {
268594
+ if (wireType !== 2)
268595
+ break;
268596
+ if (!(message.codings && message.codings.length))
268597
+ message.codings = [];
268598
+ message.codings.push($root.ClinicalNoteCoding.decode(reader, reader.uint32(), undefined, _depth + 1));
268599
+ continue;
268600
+ }
268601
+ case 2: {
268602
+ if (wireType !== 2)
268603
+ break;
268604
+ if ((value = reader.string()).length)
268605
+ message.text = value;
268606
+ else
268607
+ delete message.text;
268608
+ continue;
268609
+ }
268610
+ }
268611
+ reader.skipType(wireType, _depth, tag);
268612
+ $util.makeProp(message, "$unknowns", false);
268613
+ (message.$unknowns || (message.$unknowns = [])).push(reader.raw(start, reader.pos));
268614
+ }
268615
+ if (_end !== undefined)
268616
+ throw Error("missing end group");
268617
+ return message;
268618
+ };
268619
+
268620
+ /**
268621
+ * Decodes a ClinicalNoteCodeableConcept message from the specified reader or buffer, length delimited.
268622
+ * @function decodeDelimited
268623
+ * @memberof ClinicalNoteCodeableConcept
268624
+ * @static
268625
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
268626
+ * @returns {ClinicalNoteCodeableConcept & ClinicalNoteCodeableConcept.$Shape} ClinicalNoteCodeableConcept
268627
+ * @throws {Error} If the payload is not a reader or valid buffer
268628
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
268629
+ */
268630
+ ClinicalNoteCodeableConcept.decodeDelimited = function decodeDelimited(reader) {
268631
+ if (!(reader instanceof $Reader))
268632
+ reader = new $Reader(reader);
268633
+ return this.decode(reader, reader.uint32());
268634
+ };
268635
+
268636
+ /**
268637
+ * Verifies a ClinicalNoteCodeableConcept message.
268638
+ * @function verify
268639
+ * @memberof ClinicalNoteCodeableConcept
268640
+ * @static
268641
+ * @param {Object.<string,*>} message Plain object to verify
268642
+ * @returns {string|null} `null` if valid, otherwise the reason why it is not
268643
+ */
268644
+ ClinicalNoteCodeableConcept.verify = function verify(message, _depth) {
268645
+ if (typeof message !== "object" || message === null)
268646
+ return "object expected";
268647
+ if (_depth === undefined)
268648
+ _depth = 0;
268649
+ if (_depth > $util.recursionLimit)
268650
+ return "max depth exceeded";
268651
+ if (message.codings != null && message.hasOwnProperty("codings")) {
268652
+ if (!Array.isArray(message.codings))
268653
+ return "codings: array expected";
268654
+ for (let i = 0; i < message.codings.length; ++i) {
268655
+ let error = $root.ClinicalNoteCoding.verify(message.codings[i], _depth + 1);
268656
+ if (error)
268657
+ return "codings." + error;
268658
+ }
268659
+ }
268660
+ if (message.text != null && message.hasOwnProperty("text"))
268661
+ if (!$util.isString(message.text))
268662
+ return "text: string expected";
268663
+ return null;
268664
+ };
268665
+
268666
+ /**
268667
+ * Creates a ClinicalNoteCodeableConcept message from a plain object. Also converts values to their respective internal types.
268668
+ * @function fromObject
268669
+ * @memberof ClinicalNoteCodeableConcept
268670
+ * @static
268671
+ * @param {Object.<string,*>} object Plain object
268672
+ * @returns {ClinicalNoteCodeableConcept} ClinicalNoteCodeableConcept
268673
+ */
268674
+ ClinicalNoteCodeableConcept.fromObject = function fromObject(object, _depth) {
268675
+ if (object instanceof $root.ClinicalNoteCodeableConcept)
268676
+ return object;
268677
+ if (_depth === undefined)
268678
+ _depth = 0;
268679
+ if (_depth > $util.recursionLimit)
268680
+ throw Error("max depth exceeded");
268681
+ let message = new $root.ClinicalNoteCodeableConcept();
268682
+ if (object.codings) {
268683
+ if (!Array.isArray(object.codings))
268684
+ throw TypeError(".ClinicalNoteCodeableConcept.codings: array expected");
268685
+ message.codings = Array(object.codings.length);
268686
+ for (let i = 0; i < object.codings.length; ++i) {
268687
+ if (typeof object.codings[i] !== "object")
268688
+ throw TypeError(".ClinicalNoteCodeableConcept.codings: object expected");
268689
+ message.codings[i] = $root.ClinicalNoteCoding.fromObject(object.codings[i], _depth + 1);
268690
+ }
268691
+ }
268692
+ if (object.text != null)
268693
+ if (typeof object.text !== "string" || object.text.length)
268694
+ message.text = String(object.text);
268695
+ return message;
268696
+ };
268697
+
268698
+ /**
268699
+ * Creates a plain object from a ClinicalNoteCodeableConcept message. Also converts values to other types if specified.
268700
+ * @function toObject
268701
+ * @memberof ClinicalNoteCodeableConcept
268702
+ * @static
268703
+ * @param {ClinicalNoteCodeableConcept} message ClinicalNoteCodeableConcept
268704
+ * @param {$protobuf.IConversionOptions} [options] Conversion options
268705
+ * @returns {Object.<string,*>} Plain object
268706
+ */
268707
+ ClinicalNoteCodeableConcept.toObject = function toObject(message, options) {
268708
+ if (!options)
268709
+ options = {};
268710
+ let object = {};
268711
+ if (options.arrays || options.defaults)
268712
+ object.codings = [];
268713
+ if (options.defaults)
268714
+ object.text = "";
268715
+ if (message.codings && message.codings.length) {
268716
+ object.codings = Array(message.codings.length);
268717
+ for (let j = 0; j < message.codings.length; ++j)
268718
+ object.codings[j] = $root.ClinicalNoteCoding.toObject(message.codings[j], options);
268719
+ }
268720
+ if (message.text != null && message.hasOwnProperty("text"))
268721
+ object.text = message.text;
268722
+ return object;
268723
+ };
268724
+
268725
+ /**
268726
+ * Converts this ClinicalNoteCodeableConcept to JSON.
268727
+ * @function toJSON
268728
+ * @memberof ClinicalNoteCodeableConcept
268729
+ * @instance
268730
+ * @returns {Object.<string,*>} JSON object
268731
+ */
268732
+ ClinicalNoteCodeableConcept.prototype.toJSON = function toJSON() {
268733
+ return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
268734
+ };
268735
+
268736
+ /**
268737
+ * Gets the type url for ClinicalNoteCodeableConcept
268738
+ * @function getTypeUrl
268739
+ * @memberof ClinicalNoteCodeableConcept
268740
+ * @static
268741
+ * @param {string} [prefix] Custom type url prefix, defaults to `"type.googleapis.com"`
268742
+ * @returns {string} The type url
268743
+ */
268744
+ ClinicalNoteCodeableConcept.getTypeUrl = function getTypeUrl(prefix) {
268745
+ if (prefix === undefined)
268746
+ prefix = "type.googleapis.com";
268747
+ return prefix + "/ClinicalNoteCodeableConcept";
268748
+ };
268749
+
268750
+ return ClinicalNoteCodeableConcept;
268751
+ })();
268752
+
268753
+ /**
268754
+ * ClinicalNoteObservationCategory enum.
268755
+ * @name ClinicalNoteObservationCategory
268756
+ * @enum {number}
268757
+ * @property {number} CLINICAL_NOTE_OBSERVATION_CATEGORY_UNKNOWN=0 CLINICAL_NOTE_OBSERVATION_CATEGORY_UNKNOWN value
268758
+ * @property {number} CLINICAL_NOTE_OBSERVATION_CATEGORY_EXAM=1 CLINICAL_NOTE_OBSERVATION_CATEGORY_EXAM value
268759
+ * @property {number} CLINICAL_NOTE_OBSERVATION_CATEGORY_SOCIAL_HISTORY=2 CLINICAL_NOTE_OBSERVATION_CATEGORY_SOCIAL_HISTORY value
268760
+ * @property {number} CLINICAL_NOTE_OBSERVATION_CATEGORY_THERAPY=3 CLINICAL_NOTE_OBSERVATION_CATEGORY_THERAPY value
268761
+ */
268762
+ export const ClinicalNoteObservationCategory = $root.ClinicalNoteObservationCategory = (() => {
268763
+ const valuesById = {}, values = Object.create(valuesById);
268764
+ values[valuesById[0] = "CLINICAL_NOTE_OBSERVATION_CATEGORY_UNKNOWN"] = 0;
268765
+ values[valuesById[1] = "CLINICAL_NOTE_OBSERVATION_CATEGORY_EXAM"] = 1;
268766
+ values[valuesById[2] = "CLINICAL_NOTE_OBSERVATION_CATEGORY_SOCIAL_HISTORY"] = 2;
268767
+ values[valuesById[3] = "CLINICAL_NOTE_OBSERVATION_CATEGORY_THERAPY"] = 3;
268768
+ return values;
268769
+ })();
268770
+
268771
+ export const ClinicalNoteObservation = $root.ClinicalNoteObservation = (() => {
268772
+
268773
+ /**
268774
+ * Properties of a ClinicalNoteObservation.
268775
+ * @typedef {Object} ClinicalNoteObservation.$Properties
268776
+ * @property {string|null} [key] ClinicalNoteObservation key
268777
+ * @property {string|null} [panelKey] ClinicalNoteObservation panelKey
268778
+ * @property {ClinicalNoteObservationCategory|null} [category] ClinicalNoteObservation category
268779
+ * @property {ClinicalNoteCodeableConcept.$Properties|null} [code] ClinicalNoteObservation code
268780
+ * @property {ClinicalNoteCodeableConcept.$Properties|null} [valueConcept] ClinicalNoteObservation valueConcept
268781
+ * @property {string|null} [valueString] ClinicalNoteObservation valueString
268782
+ * @property {boolean|null} [valueBoolean] ClinicalNoteObservation valueBoolean
268783
+ * @property {string|null} [note] ClinicalNoteObservation note
268784
+ * @property {Array.<string>|null} [ds4pCodes] ClinicalNoteObservation ds4pCodes
268785
+ * @property {Array.<Uint8Array>} [$unknowns] Unknown fields preserved while decoding
268786
+ */
268787
+
268788
+ /**
268789
+ * Properties of a ClinicalNoteObservation.
268790
+ * @name IClinicalNoteObservation
268791
+ * @interface IClinicalNoteObservation
268792
+ * @augments ClinicalNoteObservation.$Properties
268793
+ * @deprecated Use ClinicalNoteObservation.$Properties instead.
268794
+ */
268795
+
268796
+ /**
268797
+ * Shape of a ClinicalNoteObservation.
268798
+ * @typedef {ClinicalNoteObservation.$Properties} ClinicalNoteObservation.$Shape
268799
+ */
268800
+
268801
+ /**
268802
+ * Constructs a new ClinicalNoteObservation.
268803
+ * @name ClinicalNoteObservation
268804
+ * @classdesc Represents a ClinicalNoteObservation.
268805
+ * @constructor
268806
+ * @param {ClinicalNoteObservation.$Properties=} [properties] Properties to set
268807
+ * @property {Array.<Uint8Array>} [$unknowns] Unknown fields preserved while decoding
268808
+ */
268809
+ function ClinicalNoteObservation(properties) {
268810
+ this.ds4pCodes = [];
268811
+ if (properties)
268812
+ for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
268813
+ if (properties[keys[i]] != null && keys[i] !== "__proto__")
268814
+ this[keys[i]] = properties[keys[i]];
268815
+ }
268816
+
268817
+ /**
268818
+ * ClinicalNoteObservation key.
268819
+ * @member {string} key
268820
+ * @memberof ClinicalNoteObservation
268821
+ * @instance
268822
+ */
268823
+ ClinicalNoteObservation.prototype.key = "";
268824
+
268825
+ /**
268826
+ * ClinicalNoteObservation panelKey.
268827
+ * @member {string} panelKey
268828
+ * @memberof ClinicalNoteObservation
268829
+ * @instance
268830
+ */
268831
+ ClinicalNoteObservation.prototype.panelKey = "";
268832
+
268833
+ /**
268834
+ * ClinicalNoteObservation category.
268835
+ * @member {ClinicalNoteObservationCategory} category
268836
+ * @memberof ClinicalNoteObservation
268837
+ * @instance
268838
+ */
268839
+ ClinicalNoteObservation.prototype.category = 0;
268840
+
268841
+ /**
268842
+ * ClinicalNoteObservation code.
268843
+ * @member {ClinicalNoteCodeableConcept.$Properties|null|undefined} code
268844
+ * @memberof ClinicalNoteObservation
268845
+ * @instance
268846
+ */
268847
+ ClinicalNoteObservation.prototype.code = null;
268848
+
268849
+ /**
268850
+ * ClinicalNoteObservation valueConcept.
268851
+ * @member {ClinicalNoteCodeableConcept.$Properties|null|undefined} valueConcept
268852
+ * @memberof ClinicalNoteObservation
268853
+ * @instance
268854
+ */
268855
+ ClinicalNoteObservation.prototype.valueConcept = null;
268856
+
268857
+ /**
268858
+ * ClinicalNoteObservation valueString.
268859
+ * @member {string} valueString
268860
+ * @memberof ClinicalNoteObservation
268861
+ * @instance
268862
+ */
268863
+ ClinicalNoteObservation.prototype.valueString = "";
268864
+
268865
+ /**
268866
+ * ClinicalNoteObservation valueBoolean.
268867
+ * @member {boolean|null|undefined} valueBoolean
268868
+ * @memberof ClinicalNoteObservation
268869
+ * @instance
268870
+ */
268871
+ ClinicalNoteObservation.prototype.valueBoolean = null;
268872
+
268873
+ /**
268874
+ * ClinicalNoteObservation note.
268875
+ * @member {string} note
268876
+ * @memberof ClinicalNoteObservation
268877
+ * @instance
268878
+ */
268879
+ ClinicalNoteObservation.prototype.note = "";
268880
+
268881
+ /**
268882
+ * ClinicalNoteObservation ds4pCodes.
268883
+ * @member {Array.<string>} ds4pCodes
268884
+ * @memberof ClinicalNoteObservation
268885
+ * @instance
268886
+ */
268887
+ ClinicalNoteObservation.prototype.ds4pCodes = $util.emptyArray;
268888
+
268889
+ // OneOf field names bound to virtual getters and setters
268890
+ let $oneOfFields;
268891
+
268892
+ // Virtual OneOf for proto3 optional field
268893
+ Object.defineProperty(ClinicalNoteObservation.prototype, "_valueBoolean", {
268894
+ get: $util.oneOfGetter($oneOfFields = ["valueBoolean"]),
268895
+ set: $util.oneOfSetter($oneOfFields)
268896
+ });
268897
+
268898
+ /**
268899
+ * Creates a new ClinicalNoteObservation instance using the specified properties.
268900
+ * @function create
268901
+ * @memberof ClinicalNoteObservation
268902
+ * @static
268903
+ * @param {ClinicalNoteObservation.$Properties=} [properties] Properties to set
268904
+ * @returns {ClinicalNoteObservation} ClinicalNoteObservation instance
268905
+ * @type {{
268906
+ * (properties: ClinicalNoteObservation.$Shape): ClinicalNoteObservation & ClinicalNoteObservation.$Shape;
268907
+ * (properties?: ClinicalNoteObservation.$Properties): ClinicalNoteObservation;
268908
+ * }}
268909
+ */
268910
+ ClinicalNoteObservation.create = function create(properties) {
268911
+ return new ClinicalNoteObservation(properties);
268912
+ };
268913
+
268914
+ /**
268915
+ * Encodes the specified ClinicalNoteObservation message. Does not implicitly {@link ClinicalNoteObservation.verify|verify} messages.
268916
+ * @function encode
268917
+ * @memberof ClinicalNoteObservation
268918
+ * @static
268919
+ * @param {ClinicalNoteObservation.$Properties} message ClinicalNoteObservation message or plain object to encode
268920
+ * @param {$protobuf.Writer} [writer] Writer to encode to
268921
+ * @returns {$protobuf.Writer} Writer
268922
+ */
268923
+ ClinicalNoteObservation.encode = function encode(message, writer) {
268924
+ if (!writer)
268925
+ writer = $Writer.create();
268926
+ if (message.key != null && Object.hasOwnProperty.call(message, "key"))
268927
+ writer.uint32(/* id 1, wireType 2 =*/10).string(message.key);
268928
+ if (message.panelKey != null && Object.hasOwnProperty.call(message, "panelKey"))
268929
+ writer.uint32(/* id 2, wireType 2 =*/18).string(message.panelKey);
268930
+ if (message.category != null && Object.hasOwnProperty.call(message, "category"))
268931
+ writer.uint32(/* id 3, wireType 0 =*/24).int32(message.category);
268932
+ if (message.code != null && Object.hasOwnProperty.call(message, "code"))
268933
+ $root.ClinicalNoteCodeableConcept.encode(message.code, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim();
268934
+ if (message.valueConcept != null && Object.hasOwnProperty.call(message, "valueConcept"))
268935
+ $root.ClinicalNoteCodeableConcept.encode(message.valueConcept, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim();
268936
+ if (message.valueString != null && Object.hasOwnProperty.call(message, "valueString"))
268937
+ writer.uint32(/* id 6, wireType 2 =*/50).string(message.valueString);
268938
+ if (message.valueBoolean != null && Object.hasOwnProperty.call(message, "valueBoolean"))
268939
+ writer.uint32(/* id 7, wireType 0 =*/56).bool(message.valueBoolean);
268940
+ if (message.note != null && Object.hasOwnProperty.call(message, "note"))
268941
+ writer.uint32(/* id 8, wireType 2 =*/66).string(message.note);
268942
+ if (message.ds4pCodes != null && message.ds4pCodes.length)
268943
+ for (let i = 0; i < message.ds4pCodes.length; ++i)
268944
+ writer.uint32(/* id 9, wireType 2 =*/74).string(message.ds4pCodes[i]);
268945
+ if (message.$unknowns != null && Object.hasOwnProperty.call(message, "$unknowns"))
268946
+ for (let i = 0; i < message.$unknowns.length; ++i)
268947
+ writer.raw(message.$unknowns[i]);
268948
+ return writer;
268949
+ };
268950
+
268951
+ /**
268952
+ * Encodes the specified ClinicalNoteObservation message, length delimited. Does not implicitly {@link ClinicalNoteObservation.verify|verify} messages.
268953
+ * @function encodeDelimited
268954
+ * @memberof ClinicalNoteObservation
268955
+ * @static
268956
+ * @param {ClinicalNoteObservation.$Properties} message ClinicalNoteObservation message or plain object to encode
268957
+ * @param {$protobuf.Writer} [writer] Writer to encode to
268958
+ * @returns {$protobuf.Writer} Writer
268959
+ */
268960
+ ClinicalNoteObservation.encodeDelimited = function encodeDelimited(message, writer) {
268961
+ return this.encode(message, writer).ldelim();
268962
+ };
268963
+
268964
+ /**
268965
+ * Decodes a ClinicalNoteObservation message from the specified reader or buffer.
268966
+ * @function decode
268967
+ * @memberof ClinicalNoteObservation
268968
+ * @static
268969
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
268970
+ * @param {number} [length] Message length if known beforehand
268971
+ * @returns {ClinicalNoteObservation & ClinicalNoteObservation.$Shape} ClinicalNoteObservation
268972
+ * @throws {Error} If the payload is not a reader or valid buffer
268973
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
268974
+ */
268975
+ ClinicalNoteObservation.decode = function decode(reader, length, _end, _depth, _target) {
268976
+ if (!(reader instanceof $Reader))
268977
+ reader = $Reader.create(reader);
268978
+ if (_depth === undefined)
268979
+ _depth = 0;
268980
+ if (_depth > $Reader.recursionLimit)
268981
+ throw Error("max depth exceeded");
268982
+ let end = length === undefined ? reader.len : reader.pos + length, message = _target || new $root.ClinicalNoteObservation(), value;
268983
+ while (reader.pos < end) {
268984
+ let start = reader.pos;
268985
+ let tag = reader.tag();
268986
+ if (tag === _end) {
268987
+ _end = undefined;
268988
+ break;
268989
+ }
268990
+ let wireType = tag & 7;
268991
+ switch (tag >>>= 3) {
268992
+ case 1: {
268993
+ if (wireType !== 2)
268994
+ break;
268995
+ if ((value = reader.string()).length)
268996
+ message.key = value;
268997
+ else
268998
+ delete message.key;
268999
+ continue;
269000
+ }
269001
+ case 2: {
269002
+ if (wireType !== 2)
269003
+ break;
269004
+ if ((value = reader.string()).length)
269005
+ message.panelKey = value;
269006
+ else
269007
+ delete message.panelKey;
269008
+ continue;
269009
+ }
269010
+ case 3: {
269011
+ if (wireType !== 0)
269012
+ break;
269013
+ if (value = reader.int32())
269014
+ message.category = value;
269015
+ else
269016
+ delete message.category;
269017
+ continue;
269018
+ }
269019
+ case 4: {
269020
+ if (wireType !== 2)
269021
+ break;
269022
+ message.code = $root.ClinicalNoteCodeableConcept.decode(reader, reader.uint32(), undefined, _depth + 1, message.code);
269023
+ continue;
269024
+ }
269025
+ case 5: {
269026
+ if (wireType !== 2)
269027
+ break;
269028
+ message.valueConcept = $root.ClinicalNoteCodeableConcept.decode(reader, reader.uint32(), undefined, _depth + 1, message.valueConcept);
269029
+ continue;
269030
+ }
269031
+ case 6: {
269032
+ if (wireType !== 2)
269033
+ break;
269034
+ if ((value = reader.string()).length)
269035
+ message.valueString = value;
269036
+ else
269037
+ delete message.valueString;
269038
+ continue;
269039
+ }
269040
+ case 7: {
269041
+ if (wireType !== 0)
269042
+ break;
269043
+ message.valueBoolean = reader.bool();
269044
+ message._valueBoolean = "valueBoolean";
269045
+ continue;
269046
+ }
269047
+ case 8: {
269048
+ if (wireType !== 2)
269049
+ break;
269050
+ if ((value = reader.string()).length)
269051
+ message.note = value;
269052
+ else
269053
+ delete message.note;
269054
+ continue;
269055
+ }
269056
+ case 9: {
269057
+ if (wireType !== 2)
269058
+ break;
269059
+ if (!(message.ds4pCodes && message.ds4pCodes.length))
269060
+ message.ds4pCodes = [];
269061
+ message.ds4pCodes.push(reader.string());
269062
+ continue;
269063
+ }
269064
+ }
269065
+ reader.skipType(wireType, _depth, tag);
269066
+ $util.makeProp(message, "$unknowns", false);
269067
+ (message.$unknowns || (message.$unknowns = [])).push(reader.raw(start, reader.pos));
269068
+ }
269069
+ if (_end !== undefined)
269070
+ throw Error("missing end group");
269071
+ return message;
269072
+ };
269073
+
269074
+ /**
269075
+ * Decodes a ClinicalNoteObservation message from the specified reader or buffer, length delimited.
269076
+ * @function decodeDelimited
269077
+ * @memberof ClinicalNoteObservation
269078
+ * @static
269079
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
269080
+ * @returns {ClinicalNoteObservation & ClinicalNoteObservation.$Shape} ClinicalNoteObservation
269081
+ * @throws {Error} If the payload is not a reader or valid buffer
269082
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
269083
+ */
269084
+ ClinicalNoteObservation.decodeDelimited = function decodeDelimited(reader) {
269085
+ if (!(reader instanceof $Reader))
269086
+ reader = new $Reader(reader);
269087
+ return this.decode(reader, reader.uint32());
269088
+ };
269089
+
269090
+ /**
269091
+ * Verifies a ClinicalNoteObservation message.
269092
+ * @function verify
269093
+ * @memberof ClinicalNoteObservation
269094
+ * @static
269095
+ * @param {Object.<string,*>} message Plain object to verify
269096
+ * @returns {string|null} `null` if valid, otherwise the reason why it is not
269097
+ */
269098
+ ClinicalNoteObservation.verify = function verify(message, _depth) {
269099
+ if (typeof message !== "object" || message === null)
269100
+ return "object expected";
269101
+ if (_depth === undefined)
269102
+ _depth = 0;
269103
+ if (_depth > $util.recursionLimit)
269104
+ return "max depth exceeded";
269105
+ let properties = {};
269106
+ if (message.key != null && message.hasOwnProperty("key"))
269107
+ if (!$util.isString(message.key))
269108
+ return "key: string expected";
269109
+ if (message.panelKey != null && message.hasOwnProperty("panelKey"))
269110
+ if (!$util.isString(message.panelKey))
269111
+ return "panelKey: string expected";
269112
+ if (message.category != null && message.hasOwnProperty("category"))
269113
+ switch (message.category) {
269114
+ default:
269115
+ return "category: enum value expected";
269116
+ case 0:
269117
+ case 1:
269118
+ case 2:
269119
+ case 3:
269120
+ break;
269121
+ }
269122
+ if (message.code != null && message.hasOwnProperty("code")) {
269123
+ let error = $root.ClinicalNoteCodeableConcept.verify(message.code, _depth + 1);
269124
+ if (error)
269125
+ return "code." + error;
269126
+ }
269127
+ if (message.valueConcept != null && message.hasOwnProperty("valueConcept")) {
269128
+ let error = $root.ClinicalNoteCodeableConcept.verify(message.valueConcept, _depth + 1);
269129
+ if (error)
269130
+ return "valueConcept." + error;
269131
+ }
269132
+ if (message.valueString != null && message.hasOwnProperty("valueString"))
269133
+ if (!$util.isString(message.valueString))
269134
+ return "valueString: string expected";
269135
+ if (message.valueBoolean != null && message.hasOwnProperty("valueBoolean")) {
269136
+ properties._valueBoolean = 1;
269137
+ if (typeof message.valueBoolean !== "boolean")
269138
+ return "valueBoolean: boolean expected";
269139
+ }
269140
+ if (message.note != null && message.hasOwnProperty("note"))
269141
+ if (!$util.isString(message.note))
269142
+ return "note: string expected";
269143
+ if (message.ds4pCodes != null && message.hasOwnProperty("ds4pCodes")) {
269144
+ if (!Array.isArray(message.ds4pCodes))
269145
+ return "ds4pCodes: array expected";
269146
+ for (let i = 0; i < message.ds4pCodes.length; ++i)
269147
+ if (!$util.isString(message.ds4pCodes[i]))
269148
+ return "ds4pCodes: string[] expected";
269149
+ }
269150
+ return null;
269151
+ };
269152
+
269153
+ /**
269154
+ * Creates a ClinicalNoteObservation message from a plain object. Also converts values to their respective internal types.
269155
+ * @function fromObject
269156
+ * @memberof ClinicalNoteObservation
269157
+ * @static
269158
+ * @param {Object.<string,*>} object Plain object
269159
+ * @returns {ClinicalNoteObservation} ClinicalNoteObservation
269160
+ */
269161
+ ClinicalNoteObservation.fromObject = function fromObject(object, _depth) {
269162
+ if (object instanceof $root.ClinicalNoteObservation)
269163
+ return object;
269164
+ if (_depth === undefined)
269165
+ _depth = 0;
269166
+ if (_depth > $util.recursionLimit)
269167
+ throw Error("max depth exceeded");
269168
+ let message = new $root.ClinicalNoteObservation();
269169
+ if (object.key != null)
269170
+ if (typeof object.key !== "string" || object.key.length)
269171
+ message.key = String(object.key);
269172
+ if (object.panelKey != null)
269173
+ if (typeof object.panelKey !== "string" || object.panelKey.length)
269174
+ message.panelKey = String(object.panelKey);
269175
+ if (object.category !== 0 && (typeof object.category !== "string" || $root.ClinicalNoteObservationCategory[object.category] !== 0))
269176
+ switch (object.category) {
269177
+ default:
269178
+ if (typeof object.category === "number") {
269179
+ message.category = object.category;
269180
+ break;
269181
+ }
269182
+ break;
269183
+ case "CLINICAL_NOTE_OBSERVATION_CATEGORY_UNKNOWN":
269184
+ case 0:
269185
+ message.category = 0;
269186
+ break;
269187
+ case "CLINICAL_NOTE_OBSERVATION_CATEGORY_EXAM":
269188
+ case 1:
269189
+ message.category = 1;
269190
+ break;
269191
+ case "CLINICAL_NOTE_OBSERVATION_CATEGORY_SOCIAL_HISTORY":
269192
+ case 2:
269193
+ message.category = 2;
269194
+ break;
269195
+ case "CLINICAL_NOTE_OBSERVATION_CATEGORY_THERAPY":
269196
+ case 3:
269197
+ message.category = 3;
269198
+ break;
269199
+ }
269200
+ if (object.code != null) {
269201
+ if (typeof object.code !== "object")
269202
+ throw TypeError(".ClinicalNoteObservation.code: object expected");
269203
+ message.code = $root.ClinicalNoteCodeableConcept.fromObject(object.code, _depth + 1);
269204
+ }
269205
+ if (object.valueConcept != null) {
269206
+ if (typeof object.valueConcept !== "object")
269207
+ throw TypeError(".ClinicalNoteObservation.valueConcept: object expected");
269208
+ message.valueConcept = $root.ClinicalNoteCodeableConcept.fromObject(object.valueConcept, _depth + 1);
269209
+ }
269210
+ if (object.valueString != null)
269211
+ if (typeof object.valueString !== "string" || object.valueString.length)
269212
+ message.valueString = String(object.valueString);
269213
+ if (object.valueBoolean != null)
269214
+ message.valueBoolean = Boolean(object.valueBoolean);
269215
+ if (object.note != null)
269216
+ if (typeof object.note !== "string" || object.note.length)
269217
+ message.note = String(object.note);
269218
+ if (object.ds4pCodes) {
269219
+ if (!Array.isArray(object.ds4pCodes))
269220
+ throw TypeError(".ClinicalNoteObservation.ds4pCodes: array expected");
269221
+ message.ds4pCodes = Array(object.ds4pCodes.length);
269222
+ for (let i = 0; i < object.ds4pCodes.length; ++i)
269223
+ message.ds4pCodes[i] = String(object.ds4pCodes[i]);
269224
+ }
269225
+ return message;
269226
+ };
269227
+
269228
+ /**
269229
+ * Creates a plain object from a ClinicalNoteObservation message. Also converts values to other types if specified.
269230
+ * @function toObject
269231
+ * @memberof ClinicalNoteObservation
269232
+ * @static
269233
+ * @param {ClinicalNoteObservation} message ClinicalNoteObservation
269234
+ * @param {$protobuf.IConversionOptions} [options] Conversion options
269235
+ * @returns {Object.<string,*>} Plain object
269236
+ */
269237
+ ClinicalNoteObservation.toObject = function toObject(message, options) {
269238
+ if (!options)
269239
+ options = {};
269240
+ let object = {};
269241
+ if (options.arrays || options.defaults)
269242
+ object.ds4pCodes = [];
269243
+ if (options.defaults) {
269244
+ object.key = "";
269245
+ object.panelKey = "";
269246
+ object.category = options.enums === String ? "CLINICAL_NOTE_OBSERVATION_CATEGORY_UNKNOWN" : 0;
269247
+ object.code = null;
269248
+ object.valueConcept = null;
269249
+ object.valueString = "";
269250
+ object.note = "";
269251
+ }
269252
+ if (message.key != null && message.hasOwnProperty("key"))
269253
+ object.key = message.key;
269254
+ if (message.panelKey != null && message.hasOwnProperty("panelKey"))
269255
+ object.panelKey = message.panelKey;
269256
+ if (message.category != null && message.hasOwnProperty("category"))
269257
+ object.category = options.enums === String ? $root.ClinicalNoteObservationCategory[message.category] === undefined ? message.category : $root.ClinicalNoteObservationCategory[message.category] : message.category;
269258
+ if (message.code != null && message.hasOwnProperty("code"))
269259
+ object.code = $root.ClinicalNoteCodeableConcept.toObject(message.code, options);
269260
+ if (message.valueConcept != null && message.hasOwnProperty("valueConcept"))
269261
+ object.valueConcept = $root.ClinicalNoteCodeableConcept.toObject(message.valueConcept, options);
269262
+ if (message.valueString != null && message.hasOwnProperty("valueString"))
269263
+ object.valueString = message.valueString;
269264
+ if (message.valueBoolean != null && message.hasOwnProperty("valueBoolean")) {
269265
+ object.valueBoolean = message.valueBoolean;
269266
+ if (options.oneofs)
269267
+ object._valueBoolean = "valueBoolean";
269268
+ }
269269
+ if (message.note != null && message.hasOwnProperty("note"))
269270
+ object.note = message.note;
269271
+ if (message.ds4pCodes && message.ds4pCodes.length) {
269272
+ object.ds4pCodes = Array(message.ds4pCodes.length);
269273
+ for (let j = 0; j < message.ds4pCodes.length; ++j)
269274
+ object.ds4pCodes[j] = message.ds4pCodes[j];
269275
+ }
269276
+ return object;
269277
+ };
269278
+
269279
+ /**
269280
+ * Converts this ClinicalNoteObservation to JSON.
269281
+ * @function toJSON
269282
+ * @memberof ClinicalNoteObservation
269283
+ * @instance
269284
+ * @returns {Object.<string,*>} JSON object
269285
+ */
269286
+ ClinicalNoteObservation.prototype.toJSON = function toJSON() {
269287
+ return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
269288
+ };
269289
+
269290
+ /**
269291
+ * Gets the type url for ClinicalNoteObservation
269292
+ * @function getTypeUrl
269293
+ * @memberof ClinicalNoteObservation
269294
+ * @static
269295
+ * @param {string} [prefix] Custom type url prefix, defaults to `"type.googleapis.com"`
269296
+ * @returns {string} The type url
269297
+ */
269298
+ ClinicalNoteObservation.getTypeUrl = function getTypeUrl(prefix) {
269299
+ if (prefix === undefined)
269300
+ prefix = "type.googleapis.com";
269301
+ return prefix + "/ClinicalNoteObservation";
269302
+ };
269303
+
269304
+ return ClinicalNoteObservation;
269305
+ })();
269306
+
269307
+ export const ClinicalNoteFamilyHistory = $root.ClinicalNoteFamilyHistory = (() => {
269308
+
269309
+ /**
269310
+ * Properties of a ClinicalNoteFamilyHistory.
269311
+ * @typedef {Object} ClinicalNoteFamilyHistory.$Properties
269312
+ * @property {string|null} [key] ClinicalNoteFamilyHistory key
269313
+ * @property {ClinicalNoteCodeableConcept.$Properties|null} [relationship] ClinicalNoteFamilyHistory relationship
269314
+ * @property {string|null} [note] ClinicalNoteFamilyHistory note
269315
+ * @property {Array.<string>|null} [ds4pCodes] ClinicalNoteFamilyHistory ds4pCodes
269316
+ * @property {Array.<Uint8Array>} [$unknowns] Unknown fields preserved while decoding
269317
+ */
269318
+
269319
+ /**
269320
+ * Properties of a ClinicalNoteFamilyHistory.
269321
+ * @name IClinicalNoteFamilyHistory
269322
+ * @interface IClinicalNoteFamilyHistory
269323
+ * @augments ClinicalNoteFamilyHistory.$Properties
269324
+ * @deprecated Use ClinicalNoteFamilyHistory.$Properties instead.
269325
+ */
269326
+
269327
+ /**
269328
+ * Shape of a ClinicalNoteFamilyHistory.
269329
+ * @typedef {ClinicalNoteFamilyHistory.$Properties} ClinicalNoteFamilyHistory.$Shape
269330
+ */
269331
+
269332
+ /**
269333
+ * Constructs a new ClinicalNoteFamilyHistory.
269334
+ * @name ClinicalNoteFamilyHistory
269335
+ * @classdesc Represents a ClinicalNoteFamilyHistory.
269336
+ * @constructor
269337
+ * @param {ClinicalNoteFamilyHistory.$Properties=} [properties] Properties to set
269338
+ * @property {Array.<Uint8Array>} [$unknowns] Unknown fields preserved while decoding
269339
+ */
269340
+ function ClinicalNoteFamilyHistory(properties) {
269341
+ this.ds4pCodes = [];
269342
+ if (properties)
269343
+ for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
269344
+ if (properties[keys[i]] != null && keys[i] !== "__proto__")
269345
+ this[keys[i]] = properties[keys[i]];
269346
+ }
269347
+
269348
+ /**
269349
+ * ClinicalNoteFamilyHistory key.
269350
+ * @member {string} key
269351
+ * @memberof ClinicalNoteFamilyHistory
269352
+ * @instance
269353
+ */
269354
+ ClinicalNoteFamilyHistory.prototype.key = "";
269355
+
269356
+ /**
269357
+ * ClinicalNoteFamilyHistory relationship.
269358
+ * @member {ClinicalNoteCodeableConcept.$Properties|null|undefined} relationship
269359
+ * @memberof ClinicalNoteFamilyHistory
269360
+ * @instance
269361
+ */
269362
+ ClinicalNoteFamilyHistory.prototype.relationship = null;
269363
+
269364
+ /**
269365
+ * ClinicalNoteFamilyHistory note.
269366
+ * @member {string} note
269367
+ * @memberof ClinicalNoteFamilyHistory
269368
+ * @instance
269369
+ */
269370
+ ClinicalNoteFamilyHistory.prototype.note = "";
269371
+
269372
+ /**
269373
+ * ClinicalNoteFamilyHistory ds4pCodes.
269374
+ * @member {Array.<string>} ds4pCodes
269375
+ * @memberof ClinicalNoteFamilyHistory
269376
+ * @instance
269377
+ */
269378
+ ClinicalNoteFamilyHistory.prototype.ds4pCodes = $util.emptyArray;
269379
+
269380
+ /**
269381
+ * Creates a new ClinicalNoteFamilyHistory instance using the specified properties.
269382
+ * @function create
269383
+ * @memberof ClinicalNoteFamilyHistory
269384
+ * @static
269385
+ * @param {ClinicalNoteFamilyHistory.$Properties=} [properties] Properties to set
269386
+ * @returns {ClinicalNoteFamilyHistory} ClinicalNoteFamilyHistory instance
269387
+ * @type {{
269388
+ * (properties: ClinicalNoteFamilyHistory.$Shape): ClinicalNoteFamilyHistory & ClinicalNoteFamilyHistory.$Shape;
269389
+ * (properties?: ClinicalNoteFamilyHistory.$Properties): ClinicalNoteFamilyHistory;
269390
+ * }}
269391
+ */
269392
+ ClinicalNoteFamilyHistory.create = function create(properties) {
269393
+ return new ClinicalNoteFamilyHistory(properties);
269394
+ };
269395
+
269396
+ /**
269397
+ * Encodes the specified ClinicalNoteFamilyHistory message. Does not implicitly {@link ClinicalNoteFamilyHistory.verify|verify} messages.
269398
+ * @function encode
269399
+ * @memberof ClinicalNoteFamilyHistory
269400
+ * @static
269401
+ * @param {ClinicalNoteFamilyHistory.$Properties} message ClinicalNoteFamilyHistory message or plain object to encode
269402
+ * @param {$protobuf.Writer} [writer] Writer to encode to
269403
+ * @returns {$protobuf.Writer} Writer
269404
+ */
269405
+ ClinicalNoteFamilyHistory.encode = function encode(message, writer) {
269406
+ if (!writer)
269407
+ writer = $Writer.create();
269408
+ if (message.key != null && Object.hasOwnProperty.call(message, "key"))
269409
+ writer.uint32(/* id 1, wireType 2 =*/10).string(message.key);
269410
+ if (message.relationship != null && Object.hasOwnProperty.call(message, "relationship"))
269411
+ $root.ClinicalNoteCodeableConcept.encode(message.relationship, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
269412
+ if (message.note != null && Object.hasOwnProperty.call(message, "note"))
269413
+ writer.uint32(/* id 3, wireType 2 =*/26).string(message.note);
269414
+ if (message.ds4pCodes != null && message.ds4pCodes.length)
269415
+ for (let i = 0; i < message.ds4pCodes.length; ++i)
269416
+ writer.uint32(/* id 4, wireType 2 =*/34).string(message.ds4pCodes[i]);
269417
+ if (message.$unknowns != null && Object.hasOwnProperty.call(message, "$unknowns"))
269418
+ for (let i = 0; i < message.$unknowns.length; ++i)
269419
+ writer.raw(message.$unknowns[i]);
269420
+ return writer;
269421
+ };
269422
+
269423
+ /**
269424
+ * Encodes the specified ClinicalNoteFamilyHistory message, length delimited. Does not implicitly {@link ClinicalNoteFamilyHistory.verify|verify} messages.
269425
+ * @function encodeDelimited
269426
+ * @memberof ClinicalNoteFamilyHistory
269427
+ * @static
269428
+ * @param {ClinicalNoteFamilyHistory.$Properties} message ClinicalNoteFamilyHistory message or plain object to encode
269429
+ * @param {$protobuf.Writer} [writer] Writer to encode to
269430
+ * @returns {$protobuf.Writer} Writer
269431
+ */
269432
+ ClinicalNoteFamilyHistory.encodeDelimited = function encodeDelimited(message, writer) {
269433
+ return this.encode(message, writer).ldelim();
269434
+ };
269435
+
269436
+ /**
269437
+ * Decodes a ClinicalNoteFamilyHistory message from the specified reader or buffer.
269438
+ * @function decode
269439
+ * @memberof ClinicalNoteFamilyHistory
269440
+ * @static
269441
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
269442
+ * @param {number} [length] Message length if known beforehand
269443
+ * @returns {ClinicalNoteFamilyHistory & ClinicalNoteFamilyHistory.$Shape} ClinicalNoteFamilyHistory
269444
+ * @throws {Error} If the payload is not a reader or valid buffer
269445
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
269446
+ */
269447
+ ClinicalNoteFamilyHistory.decode = function decode(reader, length, _end, _depth, _target) {
269448
+ if (!(reader instanceof $Reader))
269449
+ reader = $Reader.create(reader);
269450
+ if (_depth === undefined)
269451
+ _depth = 0;
269452
+ if (_depth > $Reader.recursionLimit)
269453
+ throw Error("max depth exceeded");
269454
+ let end = length === undefined ? reader.len : reader.pos + length, message = _target || new $root.ClinicalNoteFamilyHistory(), value;
269455
+ while (reader.pos < end) {
269456
+ let start = reader.pos;
269457
+ let tag = reader.tag();
269458
+ if (tag === _end) {
269459
+ _end = undefined;
269460
+ break;
269461
+ }
269462
+ let wireType = tag & 7;
269463
+ switch (tag >>>= 3) {
269464
+ case 1: {
269465
+ if (wireType !== 2)
269466
+ break;
269467
+ if ((value = reader.string()).length)
269468
+ message.key = value;
269469
+ else
269470
+ delete message.key;
269471
+ continue;
269472
+ }
269473
+ case 2: {
269474
+ if (wireType !== 2)
269475
+ break;
269476
+ message.relationship = $root.ClinicalNoteCodeableConcept.decode(reader, reader.uint32(), undefined, _depth + 1, message.relationship);
269477
+ continue;
269478
+ }
269479
+ case 3: {
269480
+ if (wireType !== 2)
269481
+ break;
269482
+ if ((value = reader.string()).length)
269483
+ message.note = value;
269484
+ else
269485
+ delete message.note;
269486
+ continue;
269487
+ }
269488
+ case 4: {
269489
+ if (wireType !== 2)
269490
+ break;
269491
+ if (!(message.ds4pCodes && message.ds4pCodes.length))
269492
+ message.ds4pCodes = [];
269493
+ message.ds4pCodes.push(reader.string());
269494
+ continue;
269495
+ }
269496
+ }
269497
+ reader.skipType(wireType, _depth, tag);
269498
+ $util.makeProp(message, "$unknowns", false);
269499
+ (message.$unknowns || (message.$unknowns = [])).push(reader.raw(start, reader.pos));
269500
+ }
269501
+ if (_end !== undefined)
269502
+ throw Error("missing end group");
269503
+ return message;
269504
+ };
269505
+
269506
+ /**
269507
+ * Decodes a ClinicalNoteFamilyHistory message from the specified reader or buffer, length delimited.
269508
+ * @function decodeDelimited
269509
+ * @memberof ClinicalNoteFamilyHistory
269510
+ * @static
269511
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
269512
+ * @returns {ClinicalNoteFamilyHistory & ClinicalNoteFamilyHistory.$Shape} ClinicalNoteFamilyHistory
269513
+ * @throws {Error} If the payload is not a reader or valid buffer
269514
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
269515
+ */
269516
+ ClinicalNoteFamilyHistory.decodeDelimited = function decodeDelimited(reader) {
269517
+ if (!(reader instanceof $Reader))
269518
+ reader = new $Reader(reader);
269519
+ return this.decode(reader, reader.uint32());
269520
+ };
269521
+
269522
+ /**
269523
+ * Verifies a ClinicalNoteFamilyHistory message.
269524
+ * @function verify
269525
+ * @memberof ClinicalNoteFamilyHistory
269526
+ * @static
269527
+ * @param {Object.<string,*>} message Plain object to verify
269528
+ * @returns {string|null} `null` if valid, otherwise the reason why it is not
269529
+ */
269530
+ ClinicalNoteFamilyHistory.verify = function verify(message, _depth) {
269531
+ if (typeof message !== "object" || message === null)
269532
+ return "object expected";
269533
+ if (_depth === undefined)
269534
+ _depth = 0;
269535
+ if (_depth > $util.recursionLimit)
269536
+ return "max depth exceeded";
269537
+ if (message.key != null && message.hasOwnProperty("key"))
269538
+ if (!$util.isString(message.key))
269539
+ return "key: string expected";
269540
+ if (message.relationship != null && message.hasOwnProperty("relationship")) {
269541
+ let error = $root.ClinicalNoteCodeableConcept.verify(message.relationship, _depth + 1);
269542
+ if (error)
269543
+ return "relationship." + error;
269544
+ }
269545
+ if (message.note != null && message.hasOwnProperty("note"))
269546
+ if (!$util.isString(message.note))
269547
+ return "note: string expected";
269548
+ if (message.ds4pCodes != null && message.hasOwnProperty("ds4pCodes")) {
269549
+ if (!Array.isArray(message.ds4pCodes))
269550
+ return "ds4pCodes: array expected";
269551
+ for (let i = 0; i < message.ds4pCodes.length; ++i)
269552
+ if (!$util.isString(message.ds4pCodes[i]))
269553
+ return "ds4pCodes: string[] expected";
269554
+ }
269555
+ return null;
269556
+ };
269557
+
269558
+ /**
269559
+ * Creates a ClinicalNoteFamilyHistory message from a plain object. Also converts values to their respective internal types.
269560
+ * @function fromObject
269561
+ * @memberof ClinicalNoteFamilyHistory
269562
+ * @static
269563
+ * @param {Object.<string,*>} object Plain object
269564
+ * @returns {ClinicalNoteFamilyHistory} ClinicalNoteFamilyHistory
269565
+ */
269566
+ ClinicalNoteFamilyHistory.fromObject = function fromObject(object, _depth) {
269567
+ if (object instanceof $root.ClinicalNoteFamilyHistory)
269568
+ return object;
269569
+ if (_depth === undefined)
269570
+ _depth = 0;
269571
+ if (_depth > $util.recursionLimit)
269572
+ throw Error("max depth exceeded");
269573
+ let message = new $root.ClinicalNoteFamilyHistory();
269574
+ if (object.key != null)
269575
+ if (typeof object.key !== "string" || object.key.length)
269576
+ message.key = String(object.key);
269577
+ if (object.relationship != null) {
269578
+ if (typeof object.relationship !== "object")
269579
+ throw TypeError(".ClinicalNoteFamilyHistory.relationship: object expected");
269580
+ message.relationship = $root.ClinicalNoteCodeableConcept.fromObject(object.relationship, _depth + 1);
269581
+ }
269582
+ if (object.note != null)
269583
+ if (typeof object.note !== "string" || object.note.length)
269584
+ message.note = String(object.note);
269585
+ if (object.ds4pCodes) {
269586
+ if (!Array.isArray(object.ds4pCodes))
269587
+ throw TypeError(".ClinicalNoteFamilyHistory.ds4pCodes: array expected");
269588
+ message.ds4pCodes = Array(object.ds4pCodes.length);
269589
+ for (let i = 0; i < object.ds4pCodes.length; ++i)
269590
+ message.ds4pCodes[i] = String(object.ds4pCodes[i]);
269591
+ }
269592
+ return message;
269593
+ };
269594
+
269595
+ /**
269596
+ * Creates a plain object from a ClinicalNoteFamilyHistory message. Also converts values to other types if specified.
269597
+ * @function toObject
269598
+ * @memberof ClinicalNoteFamilyHistory
269599
+ * @static
269600
+ * @param {ClinicalNoteFamilyHistory} message ClinicalNoteFamilyHistory
269601
+ * @param {$protobuf.IConversionOptions} [options] Conversion options
269602
+ * @returns {Object.<string,*>} Plain object
269603
+ */
269604
+ ClinicalNoteFamilyHistory.toObject = function toObject(message, options) {
269605
+ if (!options)
269606
+ options = {};
269607
+ let object = {};
269608
+ if (options.arrays || options.defaults)
269609
+ object.ds4pCodes = [];
269610
+ if (options.defaults) {
269611
+ object.key = "";
269612
+ object.relationship = null;
269613
+ object.note = "";
269614
+ }
269615
+ if (message.key != null && message.hasOwnProperty("key"))
269616
+ object.key = message.key;
269617
+ if (message.relationship != null && message.hasOwnProperty("relationship"))
269618
+ object.relationship = $root.ClinicalNoteCodeableConcept.toObject(message.relationship, options);
269619
+ if (message.note != null && message.hasOwnProperty("note"))
269620
+ object.note = message.note;
269621
+ if (message.ds4pCodes && message.ds4pCodes.length) {
269622
+ object.ds4pCodes = Array(message.ds4pCodes.length);
269623
+ for (let j = 0; j < message.ds4pCodes.length; ++j)
269624
+ object.ds4pCodes[j] = message.ds4pCodes[j];
269625
+ }
269626
+ return object;
269627
+ };
269628
+
269629
+ /**
269630
+ * Converts this ClinicalNoteFamilyHistory to JSON.
269631
+ * @function toJSON
269632
+ * @memberof ClinicalNoteFamilyHistory
269633
+ * @instance
269634
+ * @returns {Object.<string,*>} JSON object
269635
+ */
269636
+ ClinicalNoteFamilyHistory.prototype.toJSON = function toJSON() {
269637
+ return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
269638
+ };
269639
+
269640
+ /**
269641
+ * Gets the type url for ClinicalNoteFamilyHistory
269642
+ * @function getTypeUrl
269643
+ * @memberof ClinicalNoteFamilyHistory
269644
+ * @static
269645
+ * @param {string} [prefix] Custom type url prefix, defaults to `"type.googleapis.com"`
269646
+ * @returns {string} The type url
269647
+ */
269648
+ ClinicalNoteFamilyHistory.getTypeUrl = function getTypeUrl(prefix) {
269649
+ if (prefix === undefined)
269650
+ prefix = "type.googleapis.com";
269651
+ return prefix + "/ClinicalNoteFamilyHistory";
269652
+ };
269653
+
269654
+ return ClinicalNoteFamilyHistory;
269655
+ })();
269656
+
269657
+ export const GingerClinicalNotePayload = $root.GingerClinicalNotePayload = (() => {
269658
+
269659
+ /**
269660
+ * Properties of a GingerClinicalNotePayload.
269661
+ * @typedef {Object} GingerClinicalNotePayload.$Properties
269662
+ * @property {string|null} [noteId] GingerClinicalNotePayload noteId
269663
+ * @property {string|null} [hsUserId] GingerClinicalNotePayload hsUserId
269664
+ * @property {GingerClinicalNoteType|null} [noteType] GingerClinicalNotePayload noteType
269665
+ * @property {ClinicalNotePatient.$Properties|null} [patient] GingerClinicalNotePayload patient
269666
+ * @property {ClinicalNotePractitioner.$Properties|null} [practitioner] GingerClinicalNotePayload practitioner
269667
+ * @property {ClinicalNoteOrganization.$Properties|null} [organization] GingerClinicalNotePayload organization
269668
+ * @property {ClinicalNoteEncounter.$Properties|null} [encounter] GingerClinicalNotePayload encounter
269669
+ * @property {string|null} [content] GingerClinicalNotePayload content
269670
+ * @property {Array.<string>|null} [icd10Codes] GingerClinicalNotePayload icd10Codes
269671
+ * @property {Array.<string>|null} [ds4pCodes] GingerClinicalNotePayload ds4pCodes
269672
+ * @property {Array.<ClinicalNoteAllergy.$Properties>|null} [allergies] GingerClinicalNotePayload allergies
269673
+ * @property {Array.<ClinicalNoteMedication.$Properties>|null} [medications] GingerClinicalNotePayload medications
269674
+ * @property {Array.<ClinicalNoteObservation.$Properties>|null} [observations] GingerClinicalNotePayload observations
269675
+ * @property {Array.<ClinicalNoteFamilyHistory.$Properties>|null} [familyHistories] GingerClinicalNotePayload familyHistories
269676
+ * @property {Array.<Uint8Array>} [$unknowns] Unknown fields preserved while decoding
269677
+ */
269678
+
269679
+ /**
269680
+ * Properties of a GingerClinicalNotePayload.
269681
+ * @name IGingerClinicalNotePayload
269682
+ * @interface IGingerClinicalNotePayload
269683
+ * @augments GingerClinicalNotePayload.$Properties
269684
+ * @deprecated Use GingerClinicalNotePayload.$Properties instead.
269685
+ */
269686
+
269687
+ /**
269688
+ * Shape of a GingerClinicalNotePayload.
269689
+ * @typedef {GingerClinicalNotePayload.$Properties} GingerClinicalNotePayload.$Shape
269690
+ */
269691
+
269692
+ /**
269693
+ * Constructs a new GingerClinicalNotePayload.
269694
+ * @name GingerClinicalNotePayload
269695
+ * @classdesc Represents a GingerClinicalNotePayload.
269696
+ * @constructor
269697
+ * @param {GingerClinicalNotePayload.$Properties=} [properties] Properties to set
269698
+ * @property {Array.<Uint8Array>} [$unknowns] Unknown fields preserved while decoding
269699
+ */
269700
+ function GingerClinicalNotePayload(properties) {
269701
+ this.icd10Codes = [];
269702
+ this.ds4pCodes = [];
269703
+ this.allergies = [];
269704
+ this.medications = [];
269705
+ this.observations = [];
269706
+ this.familyHistories = [];
269707
+ if (properties)
269708
+ for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
269709
+ if (properties[keys[i]] != null && keys[i] !== "__proto__")
269710
+ this[keys[i]] = properties[keys[i]];
269711
+ }
269712
+
269713
+ /**
269714
+ * GingerClinicalNotePayload noteId.
269715
+ * @member {string} noteId
269716
+ * @memberof GingerClinicalNotePayload
269717
+ * @instance
269718
+ */
269719
+ GingerClinicalNotePayload.prototype.noteId = "";
269720
+
269721
+ /**
269722
+ * GingerClinicalNotePayload hsUserId.
269723
+ * @member {string} hsUserId
269724
+ * @memberof GingerClinicalNotePayload
269725
+ * @instance
269726
+ */
269727
+ GingerClinicalNotePayload.prototype.hsUserId = "";
269728
+
269729
+ /**
269730
+ * GingerClinicalNotePayload noteType.
269731
+ * @member {GingerClinicalNoteType} noteType
269732
+ * @memberof GingerClinicalNotePayload
269733
+ * @instance
269734
+ */
269735
+ GingerClinicalNotePayload.prototype.noteType = 0;
269736
+
269737
+ /**
269738
+ * GingerClinicalNotePayload patient.
269739
+ * @member {ClinicalNotePatient.$Properties|null|undefined} patient
269740
+ * @memberof GingerClinicalNotePayload
269741
+ * @instance
269742
+ */
269743
+ GingerClinicalNotePayload.prototype.patient = null;
269744
+
269745
+ /**
269746
+ * GingerClinicalNotePayload practitioner.
269747
+ * @member {ClinicalNotePractitioner.$Properties|null|undefined} practitioner
269748
+ * @memberof GingerClinicalNotePayload
269749
+ * @instance
269750
+ */
269751
+ GingerClinicalNotePayload.prototype.practitioner = null;
269752
+
269753
+ /**
269754
+ * GingerClinicalNotePayload organization.
269755
+ * @member {ClinicalNoteOrganization.$Properties|null|undefined} organization
269756
+ * @memberof GingerClinicalNotePayload
269757
+ * @instance
269758
+ */
269759
+ GingerClinicalNotePayload.prototype.organization = null;
269760
+
269761
+ /**
269762
+ * GingerClinicalNotePayload encounter.
269763
+ * @member {ClinicalNoteEncounter.$Properties|null|undefined} encounter
269764
+ * @memberof GingerClinicalNotePayload
269765
+ * @instance
269766
+ */
269767
+ GingerClinicalNotePayload.prototype.encounter = null;
269768
+
269769
+ /**
269770
+ * GingerClinicalNotePayload content.
269771
+ * @member {string} content
269772
+ * @memberof GingerClinicalNotePayload
269773
+ * @instance
269774
+ */
269775
+ GingerClinicalNotePayload.prototype.content = "";
269776
+
269777
+ /**
269778
+ * GingerClinicalNotePayload icd10Codes.
269779
+ * @member {Array.<string>} icd10Codes
269780
+ * @memberof GingerClinicalNotePayload
269781
+ * @instance
269782
+ */
269783
+ GingerClinicalNotePayload.prototype.icd10Codes = $util.emptyArray;
269784
+
269785
+ /**
269786
+ * GingerClinicalNotePayload ds4pCodes.
269787
+ * @member {Array.<string>} ds4pCodes
269788
+ * @memberof GingerClinicalNotePayload
269789
+ * @instance
269790
+ */
269791
+ GingerClinicalNotePayload.prototype.ds4pCodes = $util.emptyArray;
269792
+
269793
+ /**
269794
+ * GingerClinicalNotePayload allergies.
269795
+ * @member {Array.<ClinicalNoteAllergy.$Properties>} allergies
269796
+ * @memberof GingerClinicalNotePayload
269797
+ * @instance
269798
+ */
269799
+ GingerClinicalNotePayload.prototype.allergies = $util.emptyArray;
269800
+
269801
+ /**
269802
+ * GingerClinicalNotePayload medications.
269803
+ * @member {Array.<ClinicalNoteMedication.$Properties>} medications
269804
+ * @memberof GingerClinicalNotePayload
269805
+ * @instance
269806
+ */
269807
+ GingerClinicalNotePayload.prototype.medications = $util.emptyArray;
269808
+
269809
+ /**
269810
+ * GingerClinicalNotePayload observations.
269811
+ * @member {Array.<ClinicalNoteObservation.$Properties>} observations
269812
+ * @memberof GingerClinicalNotePayload
269813
+ * @instance
269814
+ */
269815
+ GingerClinicalNotePayload.prototype.observations = $util.emptyArray;
269816
+
269817
+ /**
269818
+ * GingerClinicalNotePayload familyHistories.
269819
+ * @member {Array.<ClinicalNoteFamilyHistory.$Properties>} familyHistories
269820
+ * @memberof GingerClinicalNotePayload
269821
+ * @instance
269822
+ */
269823
+ GingerClinicalNotePayload.prototype.familyHistories = $util.emptyArray;
269824
+
269825
+ /**
269826
+ * Creates a new GingerClinicalNotePayload instance using the specified properties.
269827
+ * @function create
269828
+ * @memberof GingerClinicalNotePayload
269829
+ * @static
269830
+ * @param {GingerClinicalNotePayload.$Properties=} [properties] Properties to set
269831
+ * @returns {GingerClinicalNotePayload} GingerClinicalNotePayload instance
269832
+ * @type {{
269833
+ * (properties: GingerClinicalNotePayload.$Shape): GingerClinicalNotePayload & GingerClinicalNotePayload.$Shape;
269834
+ * (properties?: GingerClinicalNotePayload.$Properties): GingerClinicalNotePayload;
269835
+ * }}
269836
+ */
269837
+ GingerClinicalNotePayload.create = function create(properties) {
269838
+ return new GingerClinicalNotePayload(properties);
269839
+ };
269840
+
269841
+ /**
269842
+ * Encodes the specified GingerClinicalNotePayload message. Does not implicitly {@link GingerClinicalNotePayload.verify|verify} messages.
269843
+ * @function encode
269844
+ * @memberof GingerClinicalNotePayload
269845
+ * @static
269846
+ * @param {GingerClinicalNotePayload.$Properties} message GingerClinicalNotePayload message or plain object to encode
269847
+ * @param {$protobuf.Writer} [writer] Writer to encode to
269848
+ * @returns {$protobuf.Writer} Writer
269849
+ */
269850
+ GingerClinicalNotePayload.encode = function encode(message, writer) {
269851
+ if (!writer)
269852
+ writer = $Writer.create();
269853
+ if (message.noteId != null && Object.hasOwnProperty.call(message, "noteId"))
269854
+ writer.uint32(/* id 1, wireType 2 =*/10).string(message.noteId);
269855
+ if (message.hsUserId != null && Object.hasOwnProperty.call(message, "hsUserId"))
269856
+ writer.uint32(/* id 2, wireType 2 =*/18).string(message.hsUserId);
269857
+ if (message.noteType != null && Object.hasOwnProperty.call(message, "noteType"))
269858
+ writer.uint32(/* id 3, wireType 0 =*/24).int32(message.noteType);
269859
+ if (message.patient != null && Object.hasOwnProperty.call(message, "patient"))
269860
+ $root.ClinicalNotePatient.encode(message.patient, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim();
269861
+ if (message.practitioner != null && Object.hasOwnProperty.call(message, "practitioner"))
269862
+ $root.ClinicalNotePractitioner.encode(message.practitioner, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim();
269863
+ if (message.organization != null && Object.hasOwnProperty.call(message, "organization"))
269864
+ $root.ClinicalNoteOrganization.encode(message.organization, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim();
269865
+ if (message.encounter != null && Object.hasOwnProperty.call(message, "encounter"))
269866
+ $root.ClinicalNoteEncounter.encode(message.encounter, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim();
269867
+ if (message.content != null && Object.hasOwnProperty.call(message, "content"))
269868
+ writer.uint32(/* id 8, wireType 2 =*/66).string(message.content);
269869
+ if (message.icd10Codes != null && message.icd10Codes.length)
269870
+ for (let i = 0; i < message.icd10Codes.length; ++i)
269871
+ writer.uint32(/* id 9, wireType 2 =*/74).string(message.icd10Codes[i]);
269872
+ if (message.ds4pCodes != null && message.ds4pCodes.length)
269873
+ for (let i = 0; i < message.ds4pCodes.length; ++i)
269874
+ writer.uint32(/* id 10, wireType 2 =*/82).string(message.ds4pCodes[i]);
269875
+ if (message.allergies != null && message.allergies.length)
269876
+ for (let i = 0; i < message.allergies.length; ++i)
269877
+ $root.ClinicalNoteAllergy.encode(message.allergies[i], writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim();
269878
+ if (message.medications != null && message.medications.length)
269879
+ for (let i = 0; i < message.medications.length; ++i)
269880
+ $root.ClinicalNoteMedication.encode(message.medications[i], writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim();
269881
+ if (message.observations != null && message.observations.length)
269882
+ for (let i = 0; i < message.observations.length; ++i)
269883
+ $root.ClinicalNoteObservation.encode(message.observations[i], writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim();
269884
+ if (message.familyHistories != null && message.familyHistories.length)
269885
+ for (let i = 0; i < message.familyHistories.length; ++i)
269886
+ $root.ClinicalNoteFamilyHistory.encode(message.familyHistories[i], writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim();
269887
+ if (message.$unknowns != null && Object.hasOwnProperty.call(message, "$unknowns"))
269888
+ for (let i = 0; i < message.$unknowns.length; ++i)
269889
+ writer.raw(message.$unknowns[i]);
269890
+ return writer;
269891
+ };
269892
+
269893
+ /**
269894
+ * Encodes the specified GingerClinicalNotePayload message, length delimited. Does not implicitly {@link GingerClinicalNotePayload.verify|verify} messages.
269895
+ * @function encodeDelimited
269896
+ * @memberof GingerClinicalNotePayload
269897
+ * @static
269898
+ * @param {GingerClinicalNotePayload.$Properties} message GingerClinicalNotePayload message or plain object to encode
269899
+ * @param {$protobuf.Writer} [writer] Writer to encode to
269900
+ * @returns {$protobuf.Writer} Writer
269901
+ */
269902
+ GingerClinicalNotePayload.encodeDelimited = function encodeDelimited(message, writer) {
269903
+ return this.encode(message, writer).ldelim();
269904
+ };
269905
+
269906
+ /**
269907
+ * Decodes a GingerClinicalNotePayload message from the specified reader or buffer.
269908
+ * @function decode
269909
+ * @memberof GingerClinicalNotePayload
269910
+ * @static
269911
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
269912
+ * @param {number} [length] Message length if known beforehand
269913
+ * @returns {GingerClinicalNotePayload & GingerClinicalNotePayload.$Shape} GingerClinicalNotePayload
269914
+ * @throws {Error} If the payload is not a reader or valid buffer
269915
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
269916
+ */
269917
+ GingerClinicalNotePayload.decode = function decode(reader, length, _end, _depth, _target) {
269918
+ if (!(reader instanceof $Reader))
269919
+ reader = $Reader.create(reader);
269920
+ if (_depth === undefined)
269921
+ _depth = 0;
269922
+ if (_depth > $Reader.recursionLimit)
269923
+ throw Error("max depth exceeded");
269924
+ let end = length === undefined ? reader.len : reader.pos + length, message = _target || new $root.GingerClinicalNotePayload(), value;
269925
+ while (reader.pos < end) {
269926
+ let start = reader.pos;
269927
+ let tag = reader.tag();
269928
+ if (tag === _end) {
269929
+ _end = undefined;
269930
+ break;
269931
+ }
269932
+ let wireType = tag & 7;
269933
+ switch (tag >>>= 3) {
269934
+ case 1: {
269935
+ if (wireType !== 2)
269936
+ break;
269937
+ if ((value = reader.string()).length)
269938
+ message.noteId = value;
269939
+ else
269940
+ delete message.noteId;
269941
+ continue;
269942
+ }
269943
+ case 2: {
269944
+ if (wireType !== 2)
269945
+ break;
269946
+ if ((value = reader.string()).length)
269947
+ message.hsUserId = value;
269948
+ else
269949
+ delete message.hsUserId;
269950
+ continue;
269951
+ }
269952
+ case 3: {
269953
+ if (wireType !== 0)
269954
+ break;
269955
+ if (value = reader.int32())
269956
+ message.noteType = value;
269957
+ else
269958
+ delete message.noteType;
269959
+ continue;
269960
+ }
269961
+ case 4: {
269962
+ if (wireType !== 2)
269963
+ break;
269964
+ message.patient = $root.ClinicalNotePatient.decode(reader, reader.uint32(), undefined, _depth + 1, message.patient);
269965
+ continue;
269966
+ }
269967
+ case 5: {
269968
+ if (wireType !== 2)
269969
+ break;
269970
+ message.practitioner = $root.ClinicalNotePractitioner.decode(reader, reader.uint32(), undefined, _depth + 1, message.practitioner);
269971
+ continue;
269972
+ }
269973
+ case 6: {
269974
+ if (wireType !== 2)
269975
+ break;
269976
+ message.organization = $root.ClinicalNoteOrganization.decode(reader, reader.uint32(), undefined, _depth + 1, message.organization);
269977
+ continue;
269978
+ }
269979
+ case 7: {
269980
+ if (wireType !== 2)
269981
+ break;
269982
+ message.encounter = $root.ClinicalNoteEncounter.decode(reader, reader.uint32(), undefined, _depth + 1, message.encounter);
269983
+ continue;
269984
+ }
269985
+ case 8: {
269986
+ if (wireType !== 2)
269987
+ break;
269988
+ if ((value = reader.string()).length)
269989
+ message.content = value;
269990
+ else
269991
+ delete message.content;
269992
+ continue;
269993
+ }
269994
+ case 9: {
269995
+ if (wireType !== 2)
269996
+ break;
269997
+ if (!(message.icd10Codes && message.icd10Codes.length))
269998
+ message.icd10Codes = [];
269999
+ message.icd10Codes.push(reader.string());
270000
+ continue;
270001
+ }
270002
+ case 10: {
270003
+ if (wireType !== 2)
270004
+ break;
270005
+ if (!(message.ds4pCodes && message.ds4pCodes.length))
270006
+ message.ds4pCodes = [];
270007
+ message.ds4pCodes.push(reader.string());
270008
+ continue;
270009
+ }
270010
+ case 11: {
270011
+ if (wireType !== 2)
270012
+ break;
270013
+ if (!(message.allergies && message.allergies.length))
270014
+ message.allergies = [];
270015
+ message.allergies.push($root.ClinicalNoteAllergy.decode(reader, reader.uint32(), undefined, _depth + 1));
270016
+ continue;
270017
+ }
270018
+ case 12: {
270019
+ if (wireType !== 2)
270020
+ break;
270021
+ if (!(message.medications && message.medications.length))
270022
+ message.medications = [];
268444
270023
  message.medications.push($root.ClinicalNoteMedication.decode(reader, reader.uint32(), undefined, _depth + 1));
268445
270024
  continue;
268446
270025
  }
270026
+ case 13: {
270027
+ if (wireType !== 2)
270028
+ break;
270029
+ if (!(message.observations && message.observations.length))
270030
+ message.observations = [];
270031
+ message.observations.push($root.ClinicalNoteObservation.decode(reader, reader.uint32(), undefined, _depth + 1));
270032
+ continue;
270033
+ }
270034
+ case 14: {
270035
+ if (wireType !== 2)
270036
+ break;
270037
+ if (!(message.familyHistories && message.familyHistories.length))
270038
+ message.familyHistories = [];
270039
+ message.familyHistories.push($root.ClinicalNoteFamilyHistory.decode(reader, reader.uint32(), undefined, _depth + 1));
270040
+ continue;
270041
+ }
268447
270042
  }
268448
270043
  reader.skipType(wireType, _depth, tag);
268449
270044
  $util.makeProp(message, "$unknowns", false);
@@ -268557,6 +270152,24 @@ export const GingerClinicalNotePayload = $root.GingerClinicalNotePayload = (() =
268557
270152
  return "medications." + error;
268558
270153
  }
268559
270154
  }
270155
+ if (message.observations != null && message.hasOwnProperty("observations")) {
270156
+ if (!Array.isArray(message.observations))
270157
+ return "observations: array expected";
270158
+ for (let i = 0; i < message.observations.length; ++i) {
270159
+ let error = $root.ClinicalNoteObservation.verify(message.observations[i], _depth + 1);
270160
+ if (error)
270161
+ return "observations." + error;
270162
+ }
270163
+ }
270164
+ if (message.familyHistories != null && message.hasOwnProperty("familyHistories")) {
270165
+ if (!Array.isArray(message.familyHistories))
270166
+ return "familyHistories: array expected";
270167
+ for (let i = 0; i < message.familyHistories.length; ++i) {
270168
+ let error = $root.ClinicalNoteFamilyHistory.verify(message.familyHistories[i], _depth + 1);
270169
+ if (error)
270170
+ return "familyHistories." + error;
270171
+ }
270172
+ }
268560
270173
  return null;
268561
270174
  };
268562
270175
 
@@ -268668,6 +270281,26 @@ export const GingerClinicalNotePayload = $root.GingerClinicalNotePayload = (() =
268668
270281
  message.medications[i] = $root.ClinicalNoteMedication.fromObject(object.medications[i], _depth + 1);
268669
270282
  }
268670
270283
  }
270284
+ if (object.observations) {
270285
+ if (!Array.isArray(object.observations))
270286
+ throw TypeError(".GingerClinicalNotePayload.observations: array expected");
270287
+ message.observations = Array(object.observations.length);
270288
+ for (let i = 0; i < object.observations.length; ++i) {
270289
+ if (typeof object.observations[i] !== "object")
270290
+ throw TypeError(".GingerClinicalNotePayload.observations: object expected");
270291
+ message.observations[i] = $root.ClinicalNoteObservation.fromObject(object.observations[i], _depth + 1);
270292
+ }
270293
+ }
270294
+ if (object.familyHistories) {
270295
+ if (!Array.isArray(object.familyHistories))
270296
+ throw TypeError(".GingerClinicalNotePayload.familyHistories: array expected");
270297
+ message.familyHistories = Array(object.familyHistories.length);
270298
+ for (let i = 0; i < object.familyHistories.length; ++i) {
270299
+ if (typeof object.familyHistories[i] !== "object")
270300
+ throw TypeError(".GingerClinicalNotePayload.familyHistories: object expected");
270301
+ message.familyHistories[i] = $root.ClinicalNoteFamilyHistory.fromObject(object.familyHistories[i], _depth + 1);
270302
+ }
270303
+ }
268671
270304
  return message;
268672
270305
  };
268673
270306
 
@@ -268689,6 +270322,8 @@ export const GingerClinicalNotePayload = $root.GingerClinicalNotePayload = (() =
268689
270322
  object.ds4pCodes = [];
268690
270323
  object.allergies = [];
268691
270324
  object.medications = [];
270325
+ object.observations = [];
270326
+ object.familyHistories = [];
268692
270327
  }
268693
270328
  if (options.defaults) {
268694
270329
  object.noteId = "";
@@ -268736,6 +270371,16 @@ export const GingerClinicalNotePayload = $root.GingerClinicalNotePayload = (() =
268736
270371
  for (let j = 0; j < message.medications.length; ++j)
268737
270372
  object.medications[j] = $root.ClinicalNoteMedication.toObject(message.medications[j], options);
268738
270373
  }
270374
+ if (message.observations && message.observations.length) {
270375
+ object.observations = Array(message.observations.length);
270376
+ for (let j = 0; j < message.observations.length; ++j)
270377
+ object.observations[j] = $root.ClinicalNoteObservation.toObject(message.observations[j], options);
270378
+ }
270379
+ if (message.familyHistories && message.familyHistories.length) {
270380
+ object.familyHistories = Array(message.familyHistories.length);
270381
+ for (let j = 0; j < message.familyHistories.length; ++j)
270382
+ object.familyHistories[j] = $root.ClinicalNoteFamilyHistory.toObject(message.familyHistories[j], options);
270383
+ }
268739
270384
  return object;
268740
270385
  };
268741
270386