Skip to content
This repository has been archived by the owner on Sep 20, 2020. It is now read-only.

Commit

Permalink
Support update call
Browse files Browse the repository at this point in the history
  • Loading branch information
杜興怡 committed Jan 4, 2019
1 parent 6b1c255 commit a1f0803
Show file tree
Hide file tree
Showing 3 changed files with 127 additions and 32 deletions.
13 changes: 13 additions & 0 deletions fhirbuffer.pb.ex
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,18 @@ defmodule Fhirbuffer.Search do
field :type, 2, type: :string
end

defmodule Fhirbuffer.Change do
@moduledoc false
use Protobuf, syntax: :proto3

@type t :: %__MODULE__{
resource: String.t()
}
defstruct [:resource]

field :resource, 1, type: :bytes
end

defmodule Fhirbuffer.Record do
@moduledoc false
use Protobuf, syntax: :proto3
Expand All @@ -29,6 +41,7 @@ defmodule Fhirbuffer.Fhirbuffer.Service do
use GRPC.Service, name: "fhirbuffer.Fhirbuffer"

rpc :Read, Fhirbuffer.Search, Fhirbuffer.Record
rpc :Update, Fhirbuffer.Change, Fhirbuffer.Record
end

defmodule Fhirbuffer.Fhirbuffer.Stub do
Expand Down
134 changes: 106 additions & 28 deletions fhirbuffer.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 8 additions & 4 deletions fhirbuffer.proto
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ service Fhirbuffer {
// Obtains the healthcare resource that matches the search criteria.
rpc Read(Search) returns (Record) {}

// Modifies the healthcare resource
rpc Update(Change) returns (Record) {}

}

// A search criteria to request the healthcare resource.
Expand All @@ -21,11 +24,12 @@ message Search {
string type = 2;
}

// A modification to change the healthcare resource.
message Change {
bytes resource = 1;
}

// A healthcare resource returned from the data store.
message Record {
//// string id = 1;
//// string resource_type = 2;
//// string status = 3;

bytes resource = 1;
}

0 comments on commit a1f0803

Please sign in to comment.