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

Commit a1f0803

Browse files
author
杜興怡
committed
Support update call
1 parent 6b1c255 commit a1f0803

File tree

3 files changed

+127
-32
lines changed

3 files changed

+127
-32
lines changed

fhirbuffer.pb.ex

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,18 @@ defmodule Fhirbuffer.Search do
1212
field :type, 2, type: :string
1313
end
1414

15+
defmodule Fhirbuffer.Change do
16+
@moduledoc false
17+
use Protobuf, syntax: :proto3
18+
19+
@type t :: %__MODULE__{
20+
resource: String.t()
21+
}
22+
defstruct [:resource]
23+
24+
field :resource, 1, type: :bytes
25+
end
26+
1527
defmodule Fhirbuffer.Record do
1628
@moduledoc false
1729
use Protobuf, syntax: :proto3
@@ -29,6 +41,7 @@ defmodule Fhirbuffer.Fhirbuffer.Service do
2941
use GRPC.Service, name: "fhirbuffer.Fhirbuffer"
3042

3143
rpc :Read, Fhirbuffer.Search, Fhirbuffer.Record
44+
rpc :Update, Fhirbuffer.Change, Fhirbuffer.Record
3245
end
3346

3447
defmodule Fhirbuffer.Fhirbuffer.Stub do

fhirbuffer.pb.go

Lines changed: 106 additions & 28 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

fhirbuffer.proto

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ service Fhirbuffer {
1010
// Obtains the healthcare resource that matches the search criteria.
1111
rpc Read(Search) returns (Record) {}
1212

13+
// Modifies the healthcare resource
14+
rpc Update(Change) returns (Record) {}
15+
1316
}
1417

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

27+
// A modification to change the healthcare resource.
28+
message Change {
29+
bytes resource = 1;
30+
}
31+
2432
// A healthcare resource returned from the data store.
2533
message Record {
26-
//// string id = 1;
27-
//// string resource_type = 2;
28-
//// string status = 3;
29-
3034
bytes resource = 1;
3135
}

0 commit comments

Comments
 (0)