Skip to content

Commit

Permalink
avniproject/avni-client#1438 - abnormal as transient state in observa…
Browse files Browse the repository at this point in the history
…tion.
  • Loading branch information
petmongrels committed Jul 2, 2024
1 parent 8a3da54 commit 2da0f63
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/Observation.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,17 @@ import General from "./utility/General";
import Displayable from "./Displayable";
import PersistedObject from "./PersistedObject";

const clone = function (concept, valueJSON) {
const clone = function (concept, valueJSON, abnormal) {
const observation = new Observation();
observation.concept = concept;
observation.valueJSON = valueJSON;
observation.abnormal = abnormal;
return observation;
}

class Observation extends PersistedObject {
abnormal;

static schema = {
name: "Observation",
properties: {
Expand Down Expand Up @@ -46,10 +49,11 @@ class Observation extends PersistedObject {
this.that.valueJSON = x;
}

static create(concept, value) {
static create(concept, value, abnormal = false) {
const observation = new Observation();
observation.concept = concept;
observation.valueJSON = value;
observation.abnormal = abnormal;
return observation;
}

Expand Down

0 comments on commit 2da0f63

Please sign in to comment.