All files / src/fhir conformance.coffee

50% Statements 42/84
100% Branches 2/2
1.16% Functions 1/86
49.4% Lines 41/83

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650                                                    127x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x             1x                                                     1x                                         1x                                         1x                                                                             1x                                         1x                                                                                         1x                                                                                                                             1x                                         1x                                         1x                                                                                                                       1x                                                                                                                       1x                                                                       1x                                                   1x                                                                                                                                                                                                                                                                 1x  
 
# Copyright (c) 2014 The MITRE Corporation
# All rights reserved.
# 
# Redistribution and use in source and binary forms, with or without modification, 
# are permitted provided that the following conditions are met:
# 
#     * Redistributions of source code must retain the above copyright notice, this 
#       list of conditions and the following disclaimer.
#     * Redistributions in binary form must reproduce the above copyright notice, 
#       this list of conditions and the following disclaimer in the documentation 
#       and/or other materials provided with the distribution.
#     * Neither the name of HL7 nor the names of its contributors may be used to 
#       endorse or promote products derived from this software without specific 
#       prior written permission.
# 
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 
# IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 
# INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 
# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 
# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 
# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
# POSSIBILITY OF SUCH DAMAGE.
DT = require '../cql-datatypes'
CORE = require('./core')
Element = CORE.Element
Resource = CORE.Resource
Timing = CORE.Timing
Period = CORE.Period
Parameters = CORE.Parameters
Coding = CORE.Coding
Resource = CORE.Resource
Range = CORE.Range
Quantity = CORE.Quantity
Attachment = CORE.Attachment
BackboneElement = CORE.BackboneElement
DomainResource = CORE.DomainResource
ContactPoint = CORE.ContactPoint
ElementDefinition = CORE.ElementDefinition
Extension = CORE.Extension
HumanName = CORE.HumanName
Address = CORE.Address
Ratio = CORE.Ratio
SampledData = CORE.SampledData
Reference = CORE.Reference
CodeableConcept = CORE.CodeableConcept
Identifier = CORE.Identifier
Narrative = CORE.Narrative
Element = CORE.Element
 
###* 
Embedded class
@class ConformanceSoftwareComponent
@exports  ConformanceSoftwareComponent as ConformanceSoftwareComponent
###
class ConformanceSoftwareComponent extends BackboneElement
  constructor: (@json) ->
    super(@json)
  ###*
  Name software is known by.
  @returns {Array} an array of {@link String} objects
  ###
  name:-> @json['name']
  
  ###*
  The version identifier for the software covered by this statement.
  @returns {Array} an array of {@link String} objects
  ###
  version:-> @json['version']
  
  ###*
  Date this version of the software released.
  @returns {Array} an array of {@link Date} objects
  ###
  releaseDate:-> if @json['releaseDate'] then DT.DateTime.parse(@json['releaseDate'])
  
 
###* 
Embedded class
@class ConformanceImplementationComponent
@exports  ConformanceImplementationComponent as ConformanceImplementationComponent
###
class ConformanceImplementationComponent extends BackboneElement
  constructor: (@json) ->
    super(@json)
  ###*
  Information about the specific installation that this conformance statement relates to.
  @returns {Array} an array of {@link String} objects
  ###
  description:-> @json['description']
  
  ###*
  A base URL for the implementation.  This forms the base for REST interfaces as well as the mailbox and document interfaces.
  @returns {Array} an array of {@link String} objects
  ###
  url:-> @json['url']
  
 
###* 
Embedded class
@class ConformanceRestSecurityCertificateComponent
@exports  ConformanceRestSecurityCertificateComponent as ConformanceRestSecurityCertificateComponent
###
class ConformanceRestSecurityCertificateComponent extends BackboneElement
  constructor: (@json) ->
    super(@json)
  ###*
  Mime type for certificate.
  @returns {Array} an array of {@link String} objects
  ###
  type:-> @json['type']
  
  ###*
  Actual certificate.
  @returns {Array} an array of {@link } objects
  ###
  blob:-> @json['blob']
  
 
###* 
Embedded class
@class ConformanceRestSecurityComponent
@exports  ConformanceRestSecurityComponent as ConformanceRestSecurityComponent
###
class ConformanceRestSecurityComponent extends BackboneElement
  constructor: (@json) ->
    super(@json)
  ###*
  Server adds CORS headers when responding to requests - this enables javascript applications to use the server.
  @returns {Array} an array of {@link boolean} objects
  ###
  cors:-> @json['cors']
  
  ###*
  Types of security services are supported/required by the system.
  @returns {Array} an array of {@link CodeableConcept} objects
  ###
  service: ->
    if @json['service']
      for item in @json['service']
        new CodeableConcept(item)
  
  ###*
  General description of how security works.
  @returns {Array} an array of {@link String} objects
  ###
  description:-> @json['description']
  
  ###*
  Certificates associated with security profiles.
  @returns {Array} an array of {@link ConformanceRestSecurityCertificateComponent} objects
  ###
  certificate: ->
    if @json['certificate']
      for item in @json['certificate']
        new ConformanceRestSecurityCertificateComponent(item)
  
 
###* 
Embedded class
@class ResourceInteractionComponent
@exports  ResourceInteractionComponent as ResourceInteractionComponent
###
class ResourceInteractionComponent extends BackboneElement
  constructor: (@json) ->
    super(@json)
  ###*
  Coded identifier of the operation, supported by the system resource.
  @returns {Array} an array of {@link String} objects
  ###
  code:-> @json['code']
  
  ###*
  Guidance specific to the implementation of this operation, such as 'delete is a logical delete' or 'updates are only allowed with version id' or 'creates permitted from pre-authorized certificates only'.
  @returns {Array} an array of {@link String} objects
  ###
  documentation:-> @json['documentation']
  
 
###* 
Embedded class
@class ConformanceRestResourceSearchParamComponent
@exports  ConformanceRestResourceSearchParamComponent as ConformanceRestResourceSearchParamComponent
###
class ConformanceRestResourceSearchParamComponent extends BackboneElement
  constructor: (@json) ->
    super(@json)
  ###*
  The name of the search parameter used in the interface.
  @returns {Array} an array of {@link String} objects
  ###
  name:-> @json['name']
  
  ###*
  A formal reference to where this parameter was first defined, so that a client can be confident of the meaning of the search parameter.
  @returns {Array} an array of {@link String} objects
  ###
  definition:-> @json['definition']
  
  ###*
  The type of value a search parameter refers to, and how the content is interpreted.
  @returns {Array} an array of {@link String} objects
  ###
  type:-> @json['type']
  
  ###*
  This allows documentation of any distinct behaviors about how the search parameter is used.  For example, text matching algorithms.
  @returns {Array} an array of {@link String} objects
  ###
  documentation:-> @json['documentation']
  
  ###*
  Types of resource (if a resource is referenced).
  @returns {Array} an array of {@link String} objects
  ###
  target:-> @json['target']
  
  ###*
  Chained names supported.
  @returns {Array} an array of {@link String} objects
  ###
  chain:-> @json['chain']
  
 
###* 
Embedded class
@class ConformanceRestResourceComponent
@exports  ConformanceRestResourceComponent as ConformanceRestResourceComponent
###
class ConformanceRestResourceComponent extends BackboneElement
  constructor: (@json) ->
    super(@json)
  ###*
  A type of resource exposed via the restful interface.
  @returns {Array} an array of {@link String} objects
  ###
  type:-> @json['type']
  
  ###*
  A specification of the profile that describes the solution's support for the resource, including any constraints on cardinality, bindings, lengths or other limitations.
  @returns {Reference}
  ###
  profile: -> if @json['profile'] then new Reference(@json['profile'])
  
  ###*
  Identifies a restful operation supported by the solution.
  @returns {Array} an array of {@link ResourceInteractionComponent} objects
  ###
  interaction: ->
    if @json['interaction']
      for item in @json['interaction']
        new ResourceInteractionComponent(item)
  
  ###*
  Thi field is set to true to specify that the system does not support (server) or use (client) versioning for this resource type. If this is not set to true, the server must at least correctly track and populate the versionId meta-property on resources.
  @returns {Array} an array of {@link String} objects
  ###
  versioning:-> @json['versioning']
  
  ###*
  A flag for whether the server is able to return past versions as part of the vRead operation.
  @returns {Array} an array of {@link boolean} objects
  ###
  readHistory:-> @json['readHistory']
  
  ###*
  A flag to indicate that the server allows the client to create new identities on the server. If the update operation is used (client) or allowed (server) to a new location where a resource doesn't already exist. This means that the server allows the client to create new identities on the server.
  @returns {Array} an array of {@link boolean} objects
  ###
  updateCreate:-> @json['updateCreate']
  
  ###*
  A list of _include values supported by the server.
  @returns {Array} an array of {@link String} objects
  ###
  searchInclude:-> @json['searchInclude']
  
  ###*
  Additional search parameters for implementations to support and/or make use of.
  @returns {Array} an array of {@link ConformanceRestResourceSearchParamComponent} objects
  ###
  searchParam: ->
    if @json['searchParam']
      for item in @json['searchParam']
        new ConformanceRestResourceSearchParamComponent(item)
  
 
###* 
Embedded class
@class SystemInteractionComponent
@exports  SystemInteractionComponent as SystemInteractionComponent
###
class SystemInteractionComponent extends BackboneElement
  constructor: (@json) ->
    super(@json)
  ###*
  A coded identifier of the operation, supported by the system.
  @returns {Array} an array of {@link String} objects
  ###
  code:-> @json['code']
  
  ###*
  Guidance specific to the implementation of this operation, such as limitations on the kind of transactions allowed, or information about system wide search is implemented.
  @returns {Array} an array of {@link String} objects
  ###
  documentation:-> @json['documentation']
  
 
###* 
Embedded class
@class ConformanceRestOperationComponent
@exports  ConformanceRestOperationComponent as ConformanceRestOperationComponent
###
class ConformanceRestOperationComponent extends BackboneElement
  constructor: (@json) ->
    super(@json)
  ###*
  The name of a query, which is used in the _query parameter when the query is called.
  @returns {Array} an array of {@link String} objects
  ###
  name:-> @json['name']
  
  ###*
  Where the formal definition can be found.
  @returns {Reference}
  ###
  definition: -> if @json['definition'] then new Reference(@json['definition'])
  
 
###* 
Embedded class
@class ConformanceRestComponent
@exports  ConformanceRestComponent as ConformanceRestComponent
###
class ConformanceRestComponent extends BackboneElement
  constructor: (@json) ->
    super(@json)
  ###*
  Identifies whether this portion of the statement is describing ability to initiate or receive restful operations.
  @returns {Array} an array of {@link String} objects
  ###
  mode:-> @json['mode']
  
  ###*
  Information about the system's restful capabilities that apply across all applications, such as security.
  @returns {Array} an array of {@link String} objects
  ###
  documentation:-> @json['documentation']
  
  ###*
  Information about security of implementation.
  @returns {ConformanceRestSecurityComponent}
  ###
  security: -> if @json['security'] then new ConformanceRestSecurityComponent(@json['security'])
  
  ###*
  A specification of the restful capabilities of the solution for a specific resource type.
  @returns {Array} an array of {@link ConformanceRestResourceComponent} objects
  ###
  resource: ->
    if @json['resource']
      for item in @json['resource']
        new ConformanceRestResourceComponent(item)
  
  ###*
  A specification of restful operations supported by the system.
  @returns {Array} an array of {@link SystemInteractionComponent} objects
  ###
  interaction: ->
    if @json['interaction']
      for item in @json['interaction']
        new SystemInteractionComponent(item)
  
  ###*
  Definition of an operation or a named query and with its parameters and their meaning and type.
  @returns {Array} an array of {@link ConformanceRestOperationComponent} objects
  ###
  operation: ->
    if @json['operation']
      for item in @json['operation']
        new ConformanceRestOperationComponent(item)
  
  ###*
  A list of profiles that this server implements for accepting documents in the mailbox. If this list is empty, then documents are not accepted. The base specification has the profile identifier "http://hl7.org/fhir/documents/mailbox". Other specifications can declare their own identifier for this purpose.
  @returns {Array} an array of {@link String} objects
  ###
  documentMailbox:-> @json['documentMailbox']
  
 
###* 
Embedded class
@class ConformanceMessagingEventComponent
@exports  ConformanceMessagingEventComponent as ConformanceMessagingEventComponent
###
class ConformanceMessagingEventComponent extends BackboneElement
  constructor: (@json) ->
    super(@json)
  ###*
  A coded identifier of a supported messaging event.
  @returns {Coding}
  ###
  code: -> if @json['code'] then new Coding(@json['code'])
  
  ###*
  The impact of the content of the message.
  @returns {Array} an array of {@link String} objects
  ###
  category:-> @json['category']
  
  ###*
  The mode of this event declaration - whether application is sender or receiver.
  @returns {Array} an array of {@link String} objects
  ###
  mode:-> @json['mode']
  
  ###*
  A list of the messaging transport protocol(s) identifiers, supported by this endpoint.
  @returns {Array} an array of {@link Coding} objects
  ###
  protocol: ->
    if @json['protocol']
      for item in @json['protocol']
        new Coding(item)
  
  ###*
  A resource associated with the event.  This is the resource that defines the event.
  @returns {Array} an array of {@link String} objects
  ###
  focus:-> @json['focus']
  
  ###*
  Information about the request for this event.
  @returns {Reference}
  ###
  request: -> if @json['request'] then new Reference(@json['request'])
  
  ###*
  Information about the response for this event.
  @returns {Reference}
  ###
  response: -> if @json['response'] then new Reference(@json['response'])
  
  ###*
  Guidance on how this event is handled, such as internal system trigger points, business rules, etc.
  @returns {Array} an array of {@link String} objects
  ###
  documentation:-> @json['documentation']
  
 
###* 
Embedded class
@class ConformanceMessagingComponent
@exports  ConformanceMessagingComponent as ConformanceMessagingComponent
###
class ConformanceMessagingComponent extends BackboneElement
  constructor: (@json) ->
    super(@json)
  ###*
  An address to which messages and/or replies are to be sent.
  @returns {Array} an array of {@link String} objects
  ###
  endpoint:-> @json['endpoint']
  
  ###*
  Length if the receiver's reliable messaging cache in minutes (if a receiver) or how long the cache length on the receiver should be (if a sender).
  @returns {Array} an array of {@link Number} objects
  ###
  reliableCache:-> @json['reliableCache']
  
  ###*
  Documentation about the system's messaging capabilities for this endpoint not otherwise documented by the conformance statement.  For example, process for becoming an authorized messaging exchange partner.
  @returns {Array} an array of {@link String} objects
  ###
  documentation:-> @json['documentation']
  
  ###*
  A description of the solution's support for an event at this end point.
  @returns {Array} an array of {@link ConformanceMessagingEventComponent} objects
  ###
  event: ->
    if @json['event']
      for item in @json['event']
        new ConformanceMessagingEventComponent(item)
  
 
###* 
Embedded class
@class ConformanceDocumentComponent
@exports  ConformanceDocumentComponent as ConformanceDocumentComponent
###
class ConformanceDocumentComponent extends BackboneElement
  constructor: (@json) ->
    super(@json)
  ###*
  Mode of this document declaration - whether application is producer or consumer.
  @returns {Array} an array of {@link String} objects
  ###
  mode:-> @json['mode']
  
  ###*
  A description of how the application supports or uses the specified document profile.  For example, when are documents created, what action is taken with consumed documents, etc.
  @returns {Array} an array of {@link String} objects
  ###
  documentation:-> @json['documentation']
  
  ###*
  A constraint on a resource used in the document.
  @returns {Reference}
  ###
  profile: -> if @json['profile'] then new Reference(@json['profile'])
  
###*
A conformance statement is a set of requirements for a desired implementation or a description of how a target application fulfills those requirements in a particular implementation.
@class Conformance
@exports Conformance as Conformance
###
class Conformance extends DomainResource
  constructor: (@json) ->
    super(@json)
  ###*
  The identifier that is used to identify this conformance statement when it is referenced in a specification, model, design or an instance (should be globally unique OID, UUID, or URI).
  @returns {Array} an array of {@link String} objects
  ###
  identifier:-> @json['identifier']
  
  ###*
  The identifier that is used to identify this version of the conformance statement when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the profile author manually and the value should be a timestamp.
  @returns {Array} an array of {@link String} objects
  ###
  version:-> @json['version']
  
  ###*
  A free text natural language name identifying the conformance statement.
  @returns {Array} an array of {@link String} objects
  ###
  name:-> @json['name']
  
  ###*
  Name of Organization publishing this conformance statement.
  @returns {Array} an array of {@link String} objects
  ###
  publisher:-> @json['publisher']
  
  ###*
  Contacts for Organization relevant to this conformance statement.  The contacts may be a website, email, phone numbers, etc.
  @returns {Array} an array of {@link ContactPoint} objects
  ###
  telecom: ->
    if @json['telecom']
      for item in @json['telecom']
        new ContactPoint(item)
  
  ###*
  A free text natural language description of the conformance statement and its use. Typically, this is used when the profile describes a desired rather than an actual solution, for example as a formal expression of requirements as part of an RFP.
  @returns {Array} an array of {@link String} objects
  ###
  description:-> @json['description']
  
  ###*
  The status of this conformance statement.
  @returns {Array} an array of {@link String} objects
  ###
  status:-> @json['status']
  
  ###*
  A flag to indicate that this conformance statement is authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage.
  @returns {Array} an array of {@link boolean} objects
  ###
  experimental:-> @json['experimental']
  
  ###*
  The date  (and optionally time) when the conformance statement was published.
  @returns {Array} an array of {@link Date} objects
  ###
  date:-> if @json['date'] then DT.DateTime.parse(@json['date'])
  
  ###*
  Software that is covered by this conformance statement.  It is used when the profile describes the capabilities of a particular software version, independent of an installation.
  @returns {ConformanceSoftwareComponent}
  ###
  software: -> if @json['software'] then new ConformanceSoftwareComponent(@json['software'])
  
  ###*
  Identifies a specific implementation instance that is described by the conformance statement - i.e. a particular installation, rather than the capabilities of a software program.
  @returns {ConformanceImplementationComponent}
  ###
  implementation: -> if @json['implementation'] then new ConformanceImplementationComponent(@json['implementation'])
  
  ###*
  The version of the FHIR specification on which this conformance statement is based.
  @returns {Array} an array of {@link String} objects
  ###
  fhirVersion:-> @json['fhirVersion']
  
  ###*
  A flag that indicates whether the application accepts unknown elements as part of a resource.
  @returns {Array} an array of {@link boolean} objects
  ###
  acceptUnknown:-> @json['acceptUnknown']
  
  ###*
  A list of the formats supported by this implementation.
  @returns {Array} an array of {@link String} objects
  ###
  format:-> @json['format']
  
  ###*
  A list of profiles supported by the system. For a server, "supported by the system" means the system hosts/produces a set of resources, conformant to a particular profile, and allows its clients to search using this profile and to find appropriate data. For a client, it means the system will search by this profile and process data according to the guidance implicit in the profile.
  @returns {Array} an array of {@link Reference} objects
  ###
  profile: ->
    if @json['profile']
      for item in @json['profile']
        new Reference(item)
  
  ###*
  A definition of the restful capabilities of the solution, if any.
  @returns {Array} an array of {@link ConformanceRestComponent} objects
  ###
  rest: ->
    if @json['rest']
      for item in @json['rest']
        new ConformanceRestComponent(item)
  
  ###*
  A description of the messaging capabilities of the solution.
  @returns {Array} an array of {@link ConformanceMessagingComponent} objects
  ###
  messaging: ->
    if @json['messaging']
      for item in @json['messaging']
        new ConformanceMessagingComponent(item)
  
  ###*
  A document definition.
  @returns {Array} an array of {@link ConformanceDocumentComponent} objects
  ###
  document: ->
    if @json['document']
      for item in @json['document']
        new ConformanceDocumentComponent(item)
  
 
 
 
module.exports.Conformance = Conformance