wanghaisheng / fhir-cn

FHIR中文版 the Chinese translation of FHIR
https://github.com/FHIR-CN/fhir-spec-ZhCN
73 stars 23 forks source link

Parameters 的问题 #48

Open wanghaisheng opened 9 years ago

wanghaisheng commented 9 years ago

http://hl7-fhir.github.io/parameters.html

{
  "resourceType": "Parameters",
  "parameter": [
    {
      "name": "start",
      "valueDate": "2010-01-01"
    },
    {
      "name": "end",
      "resource": {
        "resourceType": "Binary",
        "contentType": "text/plain",
        "content": "VGhpcyBpcyBhIHRlc3QgZXhhbXBsZQ=="
      }
    }
  ]
}

generate document URL: [base]/Composition/$Generate a Document 为什么没有POST PUT等方法的定义和说明

{
  "resourceType": "OperationDefinition",
  "id": "Composition-document",
  "text": {
    "status": "generated",
    "div": "<div>!-- Snipped for Brevity --></div>"
  },
  "url": "http://hl7.org/fhir/OperationDefinition/Composition-document",
  "name": "Generate a Document",
  "publisher": "HL7 (FHIR Project)",
  "contact": [
    {
      "telecom": [
        {
          "system": "url",
          "value": "http://hl7.org/fhir"
        },
        {
          "system": "email",
          "value": "fhir@lists.hl7.org"
        }
      ]
    }
  ],
  "description": "A client can ask a server to generate a fully bundled document from a composition resource.\nThe server takes the composition resource, locates all the referenced resources and other\nadditional resources as configured or requested and either returns a full document bundle,\nor returns an error. Note that since this is a search operation, the document bundle is \nwrapped inside the search bundle.\n\nIf some of the resources are located on other servers, it is at the discretion of the \nserver whether to retrieve them or return an error. If the correct version of the document \nthat would be generated already exists, then the server can return the existing one.",
  "status": "draft",
  "date": "2015-05-23T03:08:31+00:00",
  "kind": "operation",
  "code": "document",
  "system": false,
  "type": [
    "Composition"
  ],
  "instance": false,
  "parameter": [
    {
      "name": "persist",
      "use": "in",
      "min": 0,
      "max": "1",
      "documentation": "Whether to store the document at the document end-point (/Document) or not once it is generated. Value = true or false (default is for the server to decide)",
      "type": "boolean"
    },
    {
      "name": "cert",
      "use": "in",
      "min": 0,
      "max": "1",
      "documentation": "Certificate URL to use to sign the document with. The certificate should be associated with one of the attestors",
      "type": "string"
    },
    {
      "name": "pword",
      "use": "in",
      "min": 0,
      "max": "1",
      "documentation": "Password for private key if certificate requires one and the server doesn't know it by some other means. Putting the password in the URL has obvious security implications to consider. An alternative is for the client to sign the document",
      "type": "string"
    }
  ]
}
wanghaisheng commented 9 years ago

https://github.com/elastic/elasticsearch/tree/master/rest-api-spec

{
  "indices.create": {
    "documentation": "http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-create-index.html",
    "methods": ["PUT", "POST"],
    "url": {
      "path": "/{index}",
      "paths": ["/{index}"],
      "parts": {
        "index": {
          "type" : "string",
          "required" : true,
          "description" : "The name of the index"
        }
      },
      "params": {
        "timeout": {
          "type" : "time",
          "description" : "Explicit operation timeout"
        }
      }
    },
    "body": {
      "description" : "The configuration for the index (`settings` and `mappings`)"
    }
  }
}
wanghaisheng commented 9 years ago

在RESTFUL API里面对于查询参数的另一种处理是 POST [base]/[type]/_search{?[parameters]{&_format=[mime-type]}}

This has exactly the same semantics as the equivalent GET command. All these search interactions take a series of parameters that are a series of name'='value pairs encoded in the URL (or as an application/x-www-form-urlencoded submission for a POST). (See W3C HTML forms). Searches are processed as specified for the Search handling mechanism.