var model = new Goal({id: 123}); model.fetch(); console.log(model.toJSON());
@Override public Base makeProperty(int hash, String name) throws FHIRException { switch (hash) { case -1618432855: return addIdentifier(); case -892481550: return getStatusElement(); case 50511102: return addCategory(); case -1165461084: return getPriority(); case -1724546052: return getDescription(); case -1867885268: return getSubject(); case 1316793566: return getStart(); case 109757538: return getStart(); case -880905839: return getTarget(); case 247524032: return getStatusDateElement(); case 2051346646: return getStatusReasonElement(); case 175423686: return getExpressedBy(); case 874544034: return addAddresses(); case 3387378: return addNote(); case 1062482015: return addOutcomeCode(); case -782273511: return addOutcomeReference(); default: return super.makeProperty(hash, name); } }
switch (hash) { case -1618432855: // identifier this.getIdentifier().add(castToIdentifier(value)); // Identifier return value; case -892481550: // status value = new GoalStatusEnumFactory().fromType(castToCode(value)); this.status = (Enumeration) value; // Enumeration<GoalStatus> return value; case 50511102: // category this.getCategory().add(castToCodeableConcept(value)); // CodeableConcept return value; case -1165461084: // priority this.priority = castToCodeableConcept(value); // CodeableConcept return value; case -1724546052: // description this.description = castToCodeableConcept(value); // CodeableConcept return value; case -1867885268: // subject this.subject = castToReference(value); // Reference return value; case 109757538: // start this.start = castToType(value); // Type return value; case -880905839: // target return value; case 247524032: // statusDate this.statusDate = castToDate(value); // DateType return value;
@Override public Base addChild(String name) throws FHIRException { if (name.equals("identifier")) { return addIdentifier(); return addCategory(); return addAddresses(); return addNote(); return addOutcomeCode(); return addOutcomeReference();
public Goal copy() { Goal dst = new Goal(); copyValues(dst); if (identifier != null) { dst.identifier = new ArrayList<Identifier>();
/** * @return The first repetition of repeating field {@link #category}, creating it if it does not already exist */ public CodeableConcept getCategoryFirstRep() { if (getCategory().isEmpty()) { addCategory(); } return getCategory().get(0); }
/** * @return The first repetition of repeating field {@link #identifier}, creating it if it does not already exist */ public Identifier getIdentifierFirstRep() { if (getIdentifier().isEmpty()) { addIdentifier(); } return getIdentifier().get(0); }
/** * @return The first repetition of repeating field {@link #outcomeReference}, creating it if it does not already exist */ public Reference getOutcomeReferenceFirstRep() { if (getOutcomeReference().isEmpty()) { addOutcomeReference(); } return getOutcomeReference().get(0); }
/** * @return The first repetition of repeating field {@link #addresses}, creating it if it does not already exist */ public Reference getAddressesFirstRep() { if (getAddresses().isEmpty()) { addAddresses(); } return getAddresses().get(0); }
/** * @return The first repetition of repeating field {@link #outcomeCode}, creating it if it does not already exist */ public CodeableConcept getOutcomeCodeFirstRep() { if (getOutcomeCode().isEmpty()) { addOutcomeCode(); } return getOutcomeCode().get(0); }
@Override public Base setProperty(String name, Base value) throws FHIRException { if (name.equals("identifier")) { this.getIdentifier().add(castToIdentifier(value)); } else if (name.equals("status")) { value = new GoalStatusEnumFactory().fromType(castToCode(value)); this.status = (Enumeration) value; // Enumeration<GoalStatus> } else if (name.equals("category")) { this.getCategory().add(castToCodeableConcept(value)); } else if (name.equals("priority")) { this.priority = castToCodeableConcept(value); // CodeableConcept } else if (name.equals("description")) { this.description = castToCodeableConcept(value); // CodeableConcept } else if (name.equals("subject")) { this.subject = castToReference(value); // Reference } else if (name.equals("start[x]")) { this.start = castToType(value); // Type } else if (name.equals("target")) { this.target = (GoalTargetComponent) value; // GoalTargetComponent } else if (name.equals("statusDate")) { this.statusDate = castToDate(value); // DateType } else if (name.equals("statusReason")) { this.statusReason = castToString(value); // StringType } else if (name.equals("expressedBy")) { this.expressedBy = castToReference(value); // Reference } else if (name.equals("addresses")) { this.getAddresses().add(castToReference(value)); } else if (name.equals("note")) { this.getNote().add(castToAnnotation(value)); } else if (name.equals("outcomeCode")) {
/** * @deprecated Use Reference#setResource(IBaseResource) instead */ @Deprecated public Goal addGoalTarget() { Goal r = new Goal(); if (this.goalTarget == null) this.goalTarget = new ArrayList<Goal>(); this.goalTarget.add(r); return r; }
/** * @deprecated Use Reference#setResource(IBaseResource) instead */ @Deprecated public Goal addGoalTarget() { Goal r = new Goal(); if (this.goalTarget == null) this.goalTarget = new ArrayList<Goal>(); this.goalTarget.add(r); return r; }
String json = new Gson().toJson(new Goal()); File file = new File(path); RequestBody requestFile = RequestBody.create(MediaType.parse("multipart/form-data"), file); // MultipartBody.Part is used to send also the actual file name MultipartBody.Part body = MultipartBody.Part.createFormData("picture", file.getName(), requestFile); // add another part within the multipart request RequestBody jsonBody= RequestBody.create( MediaType.parse("multipart/form-data"), json); Retrofit retrofit = new Retrofit.Builder() .baseUrl(url) .addConverterFactory(GsonConverterFactory.create()) .build(); RestApi api = retrofit.create(RestApi.class); Call<ResponseBody> call = api.upload(jsonBody, body); call.enqueue(new Callback<ResponseBody>() { @Override public void onResponse(Call<ResponseBody> call, Response<ResponseBody> response) { Log.d("onResponse: ", "success"); } @Override public void onFailure(Call<ResponseBody> call, Throwable t) { Log.d("onFailure: ", t.getLocalizedMessage()); } });
Goal goal=new Goal(); goal.setGoal_name("Goal Name:- "+planGoals.getString("goal_name"));
return new MessageDefinition(); if ("Goal".equals(name)) return new Goal(); if ("Endpoint".equals(name)) return new Endpoint();
case 1260711798: return new FamilyMemberHistory(); case 2192268: return new Flag(); case 2224947: return new Goal(); case -180371167: return new GraphDefinition(); case 69076575: return new Group();