Просмотр исходного кода

ZF-12188: Disabled Google Health API (Zend_Gdata_Health) in 1.12.x branch

git-svn-id: http://framework.zend.com/svn/framework/standard/trunk@24779 44c647ce-9c0f-0410-b52a-842ac1e357ba
adamlundrigan 13 лет назад
Родитель
Сommit
68c2a6a0f7
35 измененных файлов с 72 добавлено и 5621 удалено
  1. 0 386
      demos/Zend/Gdata/Health.php
  2. 0 549
      documentation/manual/de/module_specs/Zend_Gdata_Health.xml
  3. 0 5
      documentation/manual/en/manual.xml.in
  4. 0 528
      documentation/manual/en/module_specs/Zend_Gdata_Health.xml
  5. 9 194
      library/Zend/Gdata/Health.php
  6. 10 76
      library/Zend/Gdata/Health/Extension/Ccr.php
  7. 9 85
      library/Zend/Gdata/Health/ProfileEntry.php
  8. 10 16
      library/Zend/Gdata/Health/ProfileFeed.php
  9. 10 51
      library/Zend/Gdata/Health/ProfileListEntry.php
  10. 11 9
      library/Zend/Gdata/Health/ProfileListFeed.php
  11. 13 223
      library/Zend/Gdata/Health/Query.php
  12. 0 6
      tests/TestConfiguration.php.dist
  13. 0 17
      tests/Zend/Gdata/AllTests.php
  14. 0 142
      tests/Zend/Gdata/Health/ProfileEntryTest.php
  15. 0 124
      tests/Zend/Gdata/Health/ProfileFeedTest.php
  16. 0 64
      tests/Zend/Gdata/Health/ProfileListEntryTest.php
  17. 0 154
      tests/Zend/Gdata/Health/QueryTest.php
  18. 0 559
      tests/Zend/Gdata/Health/_files/TestDataHealthProfileEntrySample.xml
  19. 0 25
      tests/Zend/Gdata/Health/_files/TestDataHealthProfileEntrySample_allergy0.xml
  20. 0 25
      tests/Zend/Gdata/Health/_files/TestDataHealthProfileEntrySample_allergy1.xml
  21. 0 52
      tests/Zend/Gdata/Health/_files/TestDataHealthProfileEntrySample_allergy_all.xml
  22. 0 28
      tests/Zend/Gdata/Health/_files/TestDataHealthProfileEntrySample_condition0.xml
  23. 0 28
      tests/Zend/Gdata/Health/_files/TestDataHealthProfileEntrySample_condition1.xml
  24. 0 58
      tests/Zend/Gdata/Health/_files/TestDataHealthProfileEntrySample_condition_all.xml
  25. 0 548
      tests/Zend/Gdata/Health/_files/TestDataHealthProfileEntrySample_just_ccr.xml
  26. 0 48
      tests/Zend/Gdata/Health/_files/TestDataHealthProfileEntrySample_medications0.xml
  27. 0 48
      tests/Zend/Gdata/Health/_files/TestDataHealthProfileEntrySample_medications1.xml
  28. 0 48
      tests/Zend/Gdata/Health/_files/TestDataHealthProfileEntrySample_medications2.xml
  29. 0 48
      tests/Zend/Gdata/Health/_files/TestDataHealthProfileEntrySample_medications3.xml
  30. 0 140
      tests/Zend/Gdata/Health/_files/TestDataHealthProfileEntrySample_medications_all.xml
  31. 0 35
      tests/Zend/Gdata/Health/_files/TestDataHealthProfileEntrySample_results0.xml
  32. 0 948
      tests/Zend/Gdata/Health/_files/TestDataHealthProfileFeedSample.xml
  33. 0 16
      tests/Zend/Gdata/Health/_files/TestDataHealthProfileListEntrySample.xml
  34. 0 21
      tests/Zend/Gdata/Health/_files/ccr_notice_sample.xml
  35. 0 317
      tests/Zend/Gdata/HealthOnlineTest.php

+ 0 - 386
demos/Zend/Gdata/Health.php

@@ -1,386 +0,0 @@
-<?php
-/**
- * Zend Framework
- *
- * LICENSE
- *
- * This source file is subject to the new BSD license that is bundled
- * with this package in the file LICENSE.txt.
- * It is also available through the world-wide-web at this URL:
- * http://framework.zend.com/license/new-bsd
- * If you did not receive a copy of the license and are unable to
- * obtain it through the world-wide-web, please send an email
- * to license@zend.com so we can send you a copy immediately.
- *
- * @category   Zend
- * @package    Zend_Gdata
- * @subpackage Demos
- * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
- * @license    http://framework.zend.com/license/new-bsd     New BSD License
- */
-
-//////////////////////////////////////////////////////////////////////////////
-// Configuration: You must change these settings before running this sample //
-//////////////////////////////////////////////////////////////////////////////
-
-// Change this to point to the location of your private signing key. See:
-// http://code.google.com/apis/health/getting_started.html#DomainRegistration
-define('HEALTH_PRIVATE_KEY', '/path/to/your/rsa_private_key.pem');
-
-//////////////////////////////////////////////////////////////////////////////
-// End Configuration                                                        //
-//////////////////////////////////////////////////////////////////////////////
-
-// Load the Zend Gdata classes.
-require_once 'Zend/Loader.php';
-Zend_Loader::loadClass('Zend_Gdata_AuthSub');
-Zend_Loader::loadClass('Zend_Gdata_Health');
-Zend_Loader::loadClass('Zend_Gdata_Health_Query');
-
-session_start();
-
-// Google H9 Sandbox AuthSub/OAuth scope
-define('SCOPE', 'https://www.google.com/h9/feeds/');
-
-try {
-  // Setup the HTTP client and fetch an AuthSub token for H9
-  $client = authenticate(@$_GET['token']);
-  $useH9 = true;
-  $healthService = new Zend_Gdata_Health($client, 'google-HealthPHPSample-v1.0', $useH9);
-} catch(Zend_Gdata_App_Exception $e) {
-  echo 'Error: ' . $e->getMessage();
-}
-?>
-
-<html>
-<head>
-<style>
-body { margin:0; }
-div { width:75%;margin-left:10px;padding:5px;font-family: "Courier New"; }
-div#tokenstats { border-bottom:5px solid;background-color:#99ccff;margin:0 0 10px 0;padding:5px;width:100%; }
-.code { margin:5px 0 5px 10px;background-color:#eee; }
-div.data{ height:600px;border:1px solid;overflow:auto; }
-</style>
-</head>
-<body>
-
-<div id="tokenstats">
-  <b>Token info</b>: <?php echo getTokenInfo($client); ?><br>
-  <b>Session Token</b>: <?php echo $client->getAuthSubToken(); ?><br>
-</div>
-
-<?php
-// =============================================================================
-// Return the user's entire profile in a single atom <entry>
-// =============================================================================
-try {
-  $snippet = '
-    // =========================================================================
-    // Return the user\'s entire profile in a single atom <entry>
-    // =========================================================================
-
-    $query = new Zend_Gdata_Health_Query();
-    $query->setDigest("true");
-    $profileFeed = $healthService->getHealthProfileFeed($query);';
-
-  $snippet2 = '
-    $entries = $profileFeed->getEntries();
-    $ccr = $entries[0]->getCcr();
-    $xmlStr = $ccr->saveXML($ccr);
-    echo "<p>" . xmlpp($xmlStr) . "</p>";';
-  echo '<div class="code"><pre>' . htmlentities($snippet . $snippet2) . '</pre></div>';
-  eval($snippet);
-} catch(Zend_Gdata_App_Exception $e) {
-  echo 'Error: ' . $e->getMessage();
-}
-
-echo '<div class="data"><pre>';
-echo 'num entries: ' . count($profileFeed->getEntries());
-eval($snippet2);
-echo '</pre></div>';
-
-// =============================================================================
-// Return a user's medication from the entire CCR
-// =============================================================================
-try {
-  $snippet = '
-    // =========================================================================
-    // Return a user\'s medication for the entire CCR
-    // =========================================================================
-    $profileFeed = $healthService->getHealthProfileFeed();';
-
-  $snippet2 = '
-    foreach ($profileFeed->entry as $entry) {
-      $medications = $entry->getCcr()->getMedications();
-      foreach ($medications as $med) {
-        $xmlStr = $med->ownerDocument->saveXML($med);
-        echo "<p>" . xmlpp($xmlStr) . "</p>";
-      }
-    }';
-
-} catch(Zend_Gdata_App_Exception $e) {
-  echo 'Error: ' . $e->getMessage();
-}
-
-echo '<div class="code"><pre>' . htmlentities($snippet . $snippet2) . '</pre></div>';
-eval($snippet);
-
-echo '<div class="data"><pre>';
-eval($snippet2);
-echo '</pre></div>';
-
-// =============================================================================
-// Category query: return a user's medication
-// =============================================================================
-try {
-  $snippet = '
-    // =========================================================================
-    // Category query: return a user\'s medication
-    // =========================================================================
-
-    $query = new Zend_Gdata_Health_Query(SCOPE . "profile/default");
-    $query->setCategory("medication");
-    $profileFeed = $healthService->getHealthProfileFeed($query);';
-
-  $snippet2 = '
-    foreach ($profileFeed->entry as $entry) {
-      $medications = $entry->getCcr()->getMedications();
-      foreach ($medications as $med) {
-        $xmlStr = $med->ownerDocument->saveXML($med);
-        echo "<p>" . xmlpp($xmlStr) . "</p>";
-      }
-    }';
-
-} catch(Zend_Gdata_App_Exception $e) {
-  echo 'Error: ' . $e->getMessage();
-}
-
-echo '<div class="code"><pre>' . htmlentities($snippet . $snippet2) . '</pre></div>';
-eval($snippet);
-
-echo '<div class="data"><pre>';
-echo 'query: ' . $query->getQueryUrl() . '<br>';
-echo 'num entries: ' . count($profileFeed->getEntries());
-eval($snippet2);
-echo '</pre></div>';
-
-// =============================================================================
-// Query for a specific item within a category: allgergy A-Fil
-// =============================================================================
-try {
-  $snippet = '
-    // =========================================================================
-    // Query for a specific item within a category: allgergy A-Fil
-    // =========================================================================
-
-    $query = new Zend_Gdata_Health_Query(SCOPE . "profile/default");
-    $query->setCategory("allergy", "A-Fil");
-    $query->setGrouped("true");
-    $profileFeed = $healthService->getHealthProfileFeed($query);';
-
-  $snippet2 = '
-    foreach ($profileFeed->getEntries() as $entry) {
-      $allergies = $entry->getCcr()->getAllergies();
-      foreach ($allergies as $allergy) {
-        $xmlStr = $allergy->ownerDocument->saveXML($allergy);
-        echo "<p>" . xmlpp($xmlStr) . "</p>";
-      }
-    }';
-
-} catch(Zend_Gdata_App_Exception $e) {
-  echo 'Error: ' . $e->getMessage();
-}
-
-echo '<div class="code"><pre>' . htmlentities($snippet . $snippet2) . '</pre></div>';
-eval($snippet);
-
-echo '<div class="data"><pre>';
-echo 'query: ' . $query->getQueryUrl() . '<br>';
-echo 'num entries: ' . count($profileFeed->getEntries());
-eval($snippet2);
-echo '</pre></div>';
-
-// =============================================================================
-// Query (and return) the user\'s medications OR conditions
-// =============================================================================
-try {
-  $snippet = '
-    // =========================================================================
-    // Query (and return) the user\'s medications OR conditions
-    // =========================================================================
-
-    $queryStr = SCOPE . "profile/default/-/medication%7Ccondition?digest=false";
-    $profileFeed = $healthService->getHealthProfileFeed($queryStr);';
-  $snippet2 = '
-    $entries = $profileFeed->getEntries();
-    foreach ($entries as $entry) {
-      $ccr = $entry->getCcr();
-      $xmlStr = $ccr->saveXML($ccr);
-      echo "<p>" . xmlpp($xmlStr) . "</p>";
-    }';
-
-  echo '<div class="code"><pre>' . htmlentities($snippet . $snippet2) . '</pre></div>';
-  eval($snippet);
-} catch(Zend_Gdata_App_Exception $e) {
-  echo 'Error: ' . $e->getMessage();
-}
-
-echo '<div class="data"><pre>';
-echo 'num entries: ' . count($profileFeed->getEntries());
-eval($snippet2);
-echo '</pre></div>';
-
-// =============================================================================
-// Send a notice to the user's profile that includes a CCR payload
-// =============================================================================
-try {
-  $snippet = '
-    // =========================================================================
-    // Send a notice to the user\'s profile that includes a CCR payload
-    // =========================================================================
-
-    $subject = "Title of your notice goes here";
-    $body = "Notice body can contain <b>html</b> entities";
-    $ccr = \'<ContinuityOfCareRecord xmlns="urn:astm-org:CCR">
-      <Body>
-       <Problems>
-        <Problem>
-          <DateTime>
-            <Type><Text>Start date</Text></Type>
-            <ExactDateTime>2007-04-04T07:00:00Z</ExactDateTime>
-          </DateTime>
-          <Description>
-            <Text>Aortic valve disorders</Text>
-            <Code>
-              <Value>410.10</Value>
-              <CodingSystem>ICD9</CodingSystem>
-              <Version>2004</Version>
-            </Code>
-          </Description>
-          <Status><Text>Active</Text></Status>
-        </Problem>
-      </Problems>
-      </Body>
-    </ContinuityOfCareRecord>\';
-    $responseEntry = $healthService->sendHealthNotice($subject, $body, "html", $ccr);';
-} catch(Zend_Gdata_App_Exception $e) {
-  echo 'Error: ' . $e->getMessage();
-}
-
-echo '<div class="code"><pre>' . htmlentities($snippet) . '</pre></div>';
-eval($snippet);
-
-echo '<div class="data"><pre>';
-echo xmlpp($responseEntry->getXML());
-echo '</pre></div>';
-
-// =============================================================================
-// Revoke the AuthSub session token
-// =============================================================================
-//$revoked = Zend_Gdata_AuthSub::AuthSubRevokeToken($client->getAuthSubToken(), $client) ? 'yes' : 'no';
-//echo '<b>Token revoked</b>: ' . @$revoked;
-//unset($_SESSION['sessionToken']);
-?>
-</body>
-</html>
-
-<?php
-function getCurrentUrl() {
-  $phpRequestUri =
-    htmlentities(substr($_SERVER['REQUEST_URI'], 0, strcspn($_SERVER['REQUEST_URI'], "\n\r")), ENT_QUOTES);
-
-  if (isset($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) == 'on') {
-    $protocol = 'https://';
-  } else {
-    $protocol = 'http://';
-  }
-  $host = $_SERVER['HTTP_HOST'];
-  if ($_SERVER['SERVER_PORT'] != '' &&
-     (($protocol == 'http://' && $_SERVER['SERVER_PORT'] != '80') ||
-     ($protocol == 'https://' && $_SERVER['SERVER_PORT'] != '443'))) {
-    $port = ':' . $_SERVER['SERVER_PORT'];
-  } else {
-    $port = '';
-  }
-  return $protocol . $host . $port . $phpRequestUri;
-}
-
-function authenticate($singleUseToken=null) {
-  $sessionToken = isset($_SESSION['sessionToken']) ? $_SESSION['sessionToken'] : null;
-
-  // If there is no AuthSub session or one-time token waiting for us,
-  // redirect the user to Google Health's AuthSub handler to get one.
-  if (!$sessionToken && !$singleUseToken) {
-    $next = getCurrentUrl();
-    $secure = 1;
-    $session = 1;
-    $authSubHandler = 'https://www.google.com/h9/authsub';
-    $permission = 1;  // 1 - allows reading of the profile && posting notices
-    $authSubURL =
-      Zend_Gdata_AuthSub::getAuthSubTokenUri($next, SCOPE, $secure, $session,
-                                             $authSubHandler);
-    $authSubURL .= '&permission=' . $permission;
-    echo '<a href="' . $authSubURL . '">Link your Google Health Account</a>';
-    exit();
-  }
-
-  $client = new Zend_Gdata_HttpClient();
-  $client->setAuthSubPrivateKeyFile(HEALTH_PRIVATE_KEY, null, true);
-
-  // Convert an AuthSub one-time token into a session token if needed
-  if ($singleUseToken && !$sessionToken) {
-    $sessionToken =
-      Zend_Gdata_AuthSub::getAuthSubSessionToken($singleUseToken, $client);
-    $_SESSION['sessionToken'] = $sessionToken;
-  }
-  $client->setAuthSubToken($sessionToken);
-  return $client;
-}
-
-function getTokenInfo($client) {
-  $sessionToken = $client->getAuthSubToken();
-  return Zend_Gdata_AuthSub::getAuthSubTokenInfo($sessionToken, $client);
-}
-
-function revokeToken($client) {
-  $sessionToken = $client->getAuthSubToken();
-  return Zend_Gdata_AuthSub::AuthSubRevokeToken($sessionToken, $client);
-}
-
-/** Prettifies an XML string into a human-readable and indented work of art
- *  @param string $xml The XML as a string
- *  @param boolean $html_output True if the output should be escaped (for use in HTML)
- */
-function xmlpp($xml, $html_output=true) {
-  $xml_obj = new SimpleXMLElement($xml);
-  $level = 4;
-  $indent = 0; // current indentation level
-  $pretty = array();
-
-  // get an array containing each XML element
-  $xml = explode("\n", preg_replace('/>\s*</', ">\n<", $xml_obj->asXML()));
-
-  // shift off opening XML tag if present
-  if (count($xml) && preg_match('/^<\?\s*xml/', $xml[0])) {
-    $pretty[] = array_shift($xml);
-  }
-
-  foreach ($xml as $el) {
-    if (preg_match('/^<([\w])+[^>\/]*>$/U', $el)) {
-      // opening tag, increase indent
-      $pretty[] = str_repeat(' ', $indent) . $el;
-      $indent += $level;
-    } else {
-      if (preg_match('/^<\/.+>$/', $el)) {
-        $indent -= $level;  // closing tag, decrease indent
-      }
-      if ($indent < 0) {
-        $indent += $level;
-      }
-      $pretty[] = str_repeat(' ', $indent) . $el;
-    }
-  }
-  $xml = implode("\n", $pretty);
-  return ($html_output) ? htmlentities($xml) : $xml;
-}
-?>

+ 0 - 549
documentation/manual/de/module_specs/Zend_Gdata_Health.xml

@@ -1,549 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- EN-Revision: 24249 -->
-<!-- Reviewed: no -->
-<sect1 id="zend.gdata.health">
-    <title>Verwenden von Google Health</title>
-
-    <para>
-        Die Google Health Data <acronym>API</acronym> wurde entwickelt um es Entwicklern zu erlauben
-        die folgenden 2 Dinge zu tun:
-
-        <itemizedlist>
-            <listitem>
-                <para>
-                    Das Google Gesundheitsprofil eines Benutzers lesen oder nach medizinischen
-                    Einträgen zu suchen die einem speziellen Kriterium entsprechen und dann die
-                    Ergebnisse zu verwenden um personalisierte Funktionalitäten basierend auf diesen
-                    Daten anzubieten.
-                </para>
-            </listitem>
-
-            <listitem>
-                <para>
-                    Neue Medizinische Daten zu einem Benutzerprofil hinzuzufügen indem CCR Daten
-                    eingefügt werden wenn eine Notiz an ein Benutzerprofil gesendet wird. Es ist zu
-                    beachten das die CCR Daten als <acronym>XML</acronym> Blob im &lt;atom&gt;
-                    Eintrag gespeichert werden. Die Bibliothek bietet keine direkten
-                    Zugriffsmethoden zu dem Objektmodell an aber es hat Helfer für das extrahieren
-                    von speziellen Feldern.
-                </para>
-            </listitem>
-        </itemizedlist>
-    </para>
-
-    <para>
-        Es gibt drei Hauptfeeds, die alle eine Authentifikation benötigen. Anders als andere Google
-        Data <acronym>API</acronym>s hat jede der Google Health Feeds ein begrenztes Set von
-        <acronym>HTTP</acronym> Anweisungen die auf Ihm ausgeführt werden können, abhängig von der
-        Authentifizierungsmethode die man verwendet (ClientLogin oder AuthSub/OAuth). Für eine Liste
-        von gestatteten Anweisungen siehe <ulink
-            url="http://code.google.com/apis/health/reference.html#Authentication">http://code.google.com/apis/health/reference.html#Authentication</ulink>.
-
-        <itemizedlist>
-            <listitem>
-                <para>
-                    <firstterm>Profil Feed</firstterm> verwende den Profilfeed um das
-                    Gesundheitsprofil eines Benutzers nach speziellen Informationen zu durchsuchen.
-                </para>
-            </listitem>
-
-            <listitem>
-                <para>
-                    <firstterm>Registrierungs Feed</firstterm>
-                    verwende den Registrierungsfeed um neue CCR Daten in ein Profil einzupflegen.
-                </para>
-            </listitem>
-
-            <listitem>
-                <para>
-                    <firstterm>Profil Listen Feed</firstterm> der Profil Listen Feed sollte
-                    verwendet werden um festzustellen mit welchem Gesundheitsprofil eines Benutzer
-                    interagiert werden soll. Dieser Feed ist nur vorhanden wenn man ClientLogin
-                    verwendet.
-                </para>
-            </listitem>
-        </itemizedlist>
-    </para>
-
-    <para>
-        Siehe <ulink
-            url="http://code.google.com/apis/health/">http://code.google.com/apis/health</ulink> für
-        weitere Informationen über die Google Health <acronym>API</acronym>.
-    </para>
-
-    <sect2 id="zend.gdata.health.connect">
-        <title>Zum Health Service verbinden</title>
-
-        <para>
-            Die Google Health <acronym>API</acronym> basiert, wie alle Google Data
-            <acronym>API</acronym>s, auf dem Atom Publishing Protokoll (APP), einem
-            <acronym>XML</acronym> basierenden Format für die Verwaltung von Web-basierenden
-            Ressourcen. Verkehr zwischen einem Client und dem Google Health Servern findet über
-            <acronym>HTTP</acronym> statt und erlaubt authentifizierte Verbindungen.
-        </para>
-
-        <para>
-            Bevor eine Transaktion stattfinden kann, muß eine Verbindung erstellt werden. Das
-            Erstellen einer Verbindung zu den Health Servern beinhaltet zwei Schritte: Erstellung
-            eines <acronym>HTTP</acronym> Clients und diesen Client an eine
-            <classname>Zend_Gdata_Health</classname> Instanz binden.
-        </para>
-
-        <sect3 id="zend.gdata.health.connect.authentication">
-            <title>Authentifikation</title>
-
-            <para>
-                Die Google Health <acronym>API</acronym> erlaubt den programmtechnischen Zugriff auf
-                das Gesundheitsprofil eines Benutzer. Es gibt drei Authentifizierungsschemata die
-                von Google Health unterstützt werden:
-            </para>
-
-            <itemizedlist>
-                <listitem>
-                    <para>
-                        <firstterm>ClientLogin</firstterm>
-                        bietet direkte Benutzername/Passwort Authentifikation zu den Health Servern.
-                        Da diese Methoden erwarten das Benutzer Ihr Passwort der Anwendung angeben
-                        müssen, wird dieses Authentifizierungsschema nur für
-                        installierte/Desktopanwendungen empfohlen.
-                    </para>
-                </listitem>
-
-                <listitem>
-                    <para>
-                        <firstterm>AuthSub</firstterm>
-                        erlaubt es einen Benutzer seine privaten Daten zu teilen. Das bietet das
-                        selbe Level der bequemlichkeit wir ClientLogin, aber ohne das
-                        Sicherheitsrisiko, was es zu einer idealen Wahl für Web-basierende
-                        Anwendungen macht. Für Google Health muß AuthSub in einem registrierten und
-                        sicheren Modus verwendet werden -- was bedeutet das alle Anfragen zur
-                        <acronym>API</acronym> digital signiert werden müssen.
-                    </para>
-                </listitem>
-
-                <listitem>
-                    <para>
-                        <firstterm>OAuth</firstterm>
-                        ist eine alternative zu AuthSub. Auch wenn dieses Authentifizierungschema
-                        nicht in diesem Dokument diskutiert wird, können weitere Informationen hier
-                        gefunden werden: <ulink
-                            url="http://code.google.com/apis/health/developers_guide_protocol.html#OAuth">Health
-                            Data <acronym>API</acronym> Developer's Guide</ulink>.
-                    </para>
-                </listitem>
-            </itemizedlist>
-
-            <para>
-                Siehe
-                <ulink url="http://code.google.com/apis/gdata/auth.html">Authentication Overview in
-                    the Google Data <acronym>API</acronym> documentation</ulink> für weitere
-                Informationen über jede Authentifizierungsmethode.
-            </para>
-        </sect3>
-
-        <sect3 id="zend.gdata.health.connect.service">
-            <title>Erstellen einer Health Service Instanz</title>
-
-            <para>
-                Um mit Google Health zu interagieren, bietet die Client Bibliothek die Serviceklasse
-                <classname>Zend_Gdata_Health</classname>. Diese Klasse bietet ein übliches Interface
-                zu den Google Data und Atom Publishing Protokoll Modellen und hilft bei der
-                Durchführung von Anfragen von und zur Health <acronym>API</acronym>.
-            </para>
-
-            <para>
-                Sobald man sich für ein Authentifizierungsschema entschieden hat, ist der nächste
-                Schritt die Erstellung einer Instanz von <classname>Zend_Gdata_Health</classname>.
-                Dieser Klasse sollte eine Instanz von <classname>Zend_Gdata_HttpClient</classname>
-                übergeben werden. Diese bietet ein Interface für- AuthSub/OAuth und ClientLogin um
-                einen speziell authentifizierten <acronym>HTTP</acronym> Client zu erstellen.
-            </para>
-
-            <para>
-                Um mit dem H9 des Entwicklers (/h9) statt Google Health (/health) nimmt der
-                Konstruktor von <classname>Zend_Gdata_Health</classname> ein optionales drittes
-                Argument mit dem man den H9 Service Name 'weaver' spezifizieren kann.
-            </para>
-
-            <para>
-                Das folgende Beispiel zeigt wie eine Health Service Klasse bei Verwendung der
-                ClientLogin Authentifizierung erstellt wird:
-            </para>
-
-            <programlisting language="php"><![CDATA[
-// Parameter für die ClientLogin Authentifikation
-$healthServiceName = Zend_Gdata_Health::HEALTH_SERVICE_NAME;
-//$h9ServiceName = Zend_Gdata_Health::H9_SANDBOX_SERVICE_NAME;
-$user = "user@gmail.com";
-$pass = "pa$$w0rd";
-
-// Erstellt einen authentifizierten HTTP Client
-$client = Zend_Gdata_ClientLogin::getHttpClient($user,
-                                                $pass,
-                                                $healthServiceName);
-
-// Erstellt eine Instanz des Health Services
-$service = new Zend_Gdata_Health($client);
-]]></programlisting>
-
-            <para>
-                Ein Health Service der AuthSub verwendet kann ähnlich erstellt werden, im einem
-                etwas längeren Aussehen. AuthSub ist das empfohlene Interface um mit Google Health
-                zu kommunizieren weil jeder Token direkt zu einem speziellen Profil im Account des
-                Benutzers verlinkt wird. Anders als andere Google Data <acronym>API</acronym>s, ist
-                es notwendig das alle Anfragen von der eigenen Anwendung digital signiert werden.
-            </para>
-
-            <programlisting language="php"><![CDATA[
-/*
- * Empfängt die aktuelle URL damit der AuthSub Server weiß wohin er den
- * Benutzer routen soll nachdem die Authentifizierung komplett ist.
- */
-function getCurrentUrl() {
-    $phpRequestUri = htmlentities(substr($_SERVER['REQUEST_URI'],
-                                         0,
-                                         strcspn($_SERVER['REQUEST_URI'],
-                                                 "\n\r")),
-                                  ENT_QUOTES);
-
-    if (isset($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) == 'on') {
-        $protocol = 'https://';
-    } else {
-        $protocol = 'http://';
-    }
-    $host = $_SERVER['HTTP_HOST'];
-    if ($_SERVER['SERVER_PORT'] != '' &&
-       (($protocol == 'http://' && $_SERVER['SERVER_PORT'] != '80') ||
-       ($protocol == 'https://' && $_SERVER['SERVER_PORT'] != '443'))) {
-        $port = ':' . $_SERVER['SERVER_PORT'];
-    } else {
-        $port = '';
-    }
-    return $protocol . $host . $port . $phpRequestUri;
-}
-
-/*
- * Leitet einen Benutzer zu AuthSub um wenn er keinen gültigen Session Token
- * hat. Wenn er von AuthSub mit einem einmal-zu-verwendenden Token zurückkommt,
- * wird ein neuer HTTP Client initialisiert und der Token mit eine langlebigen
- * Sessiontoken getauscht.
- */
-function setupClient($singleUseToken = null) {
-    $client = null;
-
-    // Einen neuen AuthSub Token holen?
-    if (!$singleUseToken) {
-        $next = getCurrentUrl();
-        $scope = 'https://www.google.com/health/feeds';
-        $authSubHandler = 'https://www.google.com/health/authsub';
-        $secure = 1;
-        $session = 1;
-        $authSubURL =  Zend_Gdata_AuthSub::getAuthSubTokenUri($next,
-                                                              $scope,
-                                                              $secure,
-                                                              $session,
-                                                              $authSubHandler);
-
-         // 1 - Erlaubt es Notizen zu schicken und das Lesen von Profildaten
-        $permission = 1;
-        $authSubURL .= '&permission=' . $permission;
-
-        echo '<a href="' . $authSubURL . '">Dein Google Health Account</a>';
-    } else {
-        $client = new Zend_Gdata_HttpClient();
-
-        // Setzen des privaten Schlüssels mit dem nachfolgende Anfragen
-        // signiert werden
-        $client->setAuthSubPrivateKeyFile('/path/to/your/rsa_private_key.pem',
-                                          null,
-                                          true);
-
-        $sessionToken =
-            Zend_Gdata_AuthSub::getAuthSubSessionToken(trim($singleUseToken),
-                                                       $client);
-
-        // Setzt den langlebigen Sessiontoken für nachfolgende Anfragen
-        $client->setAuthSubToken($sessionToken);
-    }
-    return $client;
-}
-
-// -> Skriptausführung beginnt hier <-
-
-session_start();
-
-$client = setupClient(@$_GET['token']);
-
-// Erstellt eine Instanz des Health Services
-$userH9Sandbox = false;
-$healthService = new Zend_Gdata_Health($client,
-                                       'googleInc-MyTestAppName-v1.0',
-                                       $userH9Sandbox);
-]]></programlisting>
-
-            <para>
-                Achtung: der Rest dieses Dokument wird annehmen das man AuthSub für die
-                Authentifikation verwendet.
-            </para>
-        </sect3>
-    </sect2>
-
-    <sect2 id="zend.gdata.health.profilefeed">
-        <title>Profil Feed</title>
-
-        <para>
-            Um den Profil Feed des Benutzers abzufragen, muß man sicherstellen das der initiale
-            AuthSub Token angefragt wird wobei der <property>permission</property> Parameter auf
-            <emphasis>1</emphasis> gesetzt ist. Der Prozess des extrahierens von Daten aus dem
-            Profil benötigt zwei Schritte. Das Senden einer Anfrage und dem durchlaufen des
-            resultierenden Feeds.
-        </para>
-
-        <sect3 id="zend.gdata.health.profilefeed.query">
-            <title>Eine strukturierte Anfrage senden</title>
-
-            <para>
-                Man kann strukturierte Anfragen senden um spezielle Einträge von einem
-                Benutzerprofil zu erhalten.
-            </para>
-
-            <para>
-                Wenn man die Health <acronym>API</acronym> verwendet um ein Profil zu empfangen,
-                werden speziell konstruierte Anfrage <acronym>URL</acronym>s verwendet um zu
-                beschreiben welche (CCR) Daten zurückgegeben werden sollen. Die Klasse
-                <classname>Zend_Gdata_Health_Query</classname> hilft dabei diese Aufgabe zu
-                vereinfachen indem automatisch eine Abfrage <acronym>URL</acronym> erstellt wird
-                basierend auf den Parametern die man gesetzt hat.
-            </para>
-
-            <sect4 id="zend.gdata.health.profilefeed.query.construct">
-                <title>Den Feed abfragen</title>
-
-                <para>
-                    Um eine Abfrage eines Profil Feeds durchzuführen, muß eine neue Instanz von
-                    <classname>Zend_Gdata_Health_Query</classname> erzeugt und die
-                    <methodname>getHealthProfileFeed()</methodname> Methode des Services aufgerufen
-                    werden:
-                </para>
-
-                <programlisting language="php"><![CDATA[
-$healthService = new Zend_Gdata_Health($client);
-
-// Beispielabfrage für die besten 10 Medikationen mit jeweils 2 Elementen
-$query = new Zend_Gdata_Health_Query();
-$query->setDigest("true");
-$query->setGrouped("true");
-$query->setMaxResultsGroup(10);
-$query->setMaxResultsInGroup(2);
-$query->setCategory("medication");
-
-$profileFeed = $healthService->getHealthProfileFeed($query);
-]]></programlisting>
-
-                <para>
-                    Wenn man <methodname>setDigest("true")</methodname> verwendet werden alle CCR
-                    Daten des Benutzers in einem einzelnen Atom <emphasis>&lt;entry&gt;</emphasis>
-                    zurückgegeben.
-                </para>
-
-                <para>
-                    Dem <methodname>setCategory()</methodname> Helfer kann ein zusätzlicher
-                    Parameter übergeben werden um spezifischere CCR Informationen zurückzuerhalten.
-                    Um zum Beispiel nur die Medikation Lipitor zurückzugeben verwendet man
-                    <methodname>setCategory("medication", "Lipitor")</methodname>. Die selbe Methode
-                    kann bei anderen Kategorien wie Konditionen, Allergien, Labor Ergebnisse, usw.
-                    angewendet werden.
-                </para>
-
-                <para>
-                    Eine komplette Liste der unterstützten Abfrageparameter ist im <ulink
-                        url="http://code.google.com/apis/health/reference.html#Parameters">Kapitel
-                        der Abfrageparameter</ulink> des Health <acronym>API</acronym> Referenz
-                    Guides vorhanden.
-                </para>
-            </sect4>
-        </sect3>
-
-        <sect3 id="zend.gdata.health.profilefeed.iterate">
-            <title>Durch die Profil Einträge iterieren</title>
-
-            <para>
-                Jeder Google Health Eintrag enthält CCR Daten, trotzem führt die Verwendung des
-                Abfrageparameters <property>digest</property> mit <constant>TRUE</constant> dazu
-                dass alle CCR Elemente (die dieser Abfrage entsprechen) in einen einzelnen Atom
-                <emphasis>&lt;entry&gt;</emphasis> zusammengefügt werden.
-            </para>
-
-            <para>
-                Um die kompletten CCR Informationen von einem Eintrag zu erhalten, muß ein Aufruf
-                zur <methodname>getCcr()</methodname> Methode der
-                <classname>Zend_Gdata_Health_ProfileEntry</classname> Klasse durchgeführt werden.
-                Das gibt ein <classname>Zend_Gdata_Health_Extension_CCR</classname> zurück:
-            </para>
-
-            <programlisting language="php"><![CDATA[
-$entries = $profileFeed->getEntries();
-foreach ($entries as $entry) {
-    $medications = $entry->getCcr()->getMedications();
-    //$conditions = $entry->getCcr()->getConditions();
-    //$immunizations = $entry->getCcr()->getImmunizations();
-
-    // Das CCR XML ausgeben (das werden nur die Medikationen des Eintrags sein)
-    foreach ($medications as $med) {
-        $xmlStr = $med->ownerDocument->saveXML($med);
-        echo "<pre>" . $xmlStr . "</pre>";
-    }
-}
-]]></programlisting>
-
-            <para>
-                Hier wird die <methodname>getCcr()</methodname> Methode in Verbindung mit einem
-                magischen Helfer verwendet um nur die Medikationsdaten aufzureißen und aus den CCR
-                des Eintrags zu extrahieren. Der hierbei erwähnte magische Helfer nimmt das Formular
-                <methodname>getCATEGORYNAME()</methodname>, wobei <constant>CATEGORYNAME</constant>
-                eine unterstützte Kategorie von Google Health ist. Für mögliche Kategorien kann in
-                den <ulink url="http://code.google.com/apis/health/reference.html#CatQueries">Google
-                    Health Referenz Guide</ulink> gesehen werden.
-            </para>
-
-            <para>
-                Um effizienter zu sein, können auch Kategorie Abfragen verwendet werden um nur die
-                notwendigen CCRs von den Google Health Servern zu erhalten. Dann muß durch diese
-                Ergebnisse iteriert werden:
-            </para>
-
-            <programlisting language="php"><![CDATA[
-$query = new Zend_Gdata_Health_Query();
-$query->setDigest("true");
-$query->setCategory("condition");
-$profileFeed = $healthService->getHealthProfileFeed($query);
-
-// Da die Abfrage digest=true enthält, wird nur der Atom Eintrag zurückgegeben
-$entry = $profileFeed->entry[0];
-$conditions = $entry->getCcr()->getConditions();
-
-// Die CCR Daten ausgeben (das sind nur die Konditionen des Profils)
-foreach ($conditions as $cond) {
-    $xmlStr = $cond->ownerDocument->saveXML($cond);
-    echo "<pre>" . $xmlStr . "</pre>";
-}
-]]></programlisting>
-        </sect3>
-    </sect2>
-
-    <sect2 id="zend.gdata.health.profilelist">
-        <title>Profil Listen Feed</title>
-
-        <para>
-            Beachte: Dieser Feed ist nur vorhanden wenn man ClientLogin verwendet
-        </para>
-
-        <para>
-            Da ClientLogin bei jedem seiner Feeds eine Profil ID benötigt, sollten Anwendungen
-            diesen Feed als erstes abfragen um die richtigen Profile auszuwählen. Der Profil Listen
-            Feed gibt Atom Einträge zurück die jedem Profil im Benutzeraccount von Google Health
-            entsprechen. Die ProfilID wird im Atom <emphasis>&lt;content&gt;</emphasis> und der Name
-            im <emphasis>&lt;title&gt;</emphasis> Element zurückgegeben.
-        </para>
-
-        <sect3 id="zend.gdata.health.profilelist.query">
-            <title>Den Feed abfragen</title>
-
-            <para>
-                Um eine Abfrage gegen den Profil Listen Feed durchzuführen muß die
-                <methodname>getHealthProfileListFeed()</methodname> Methode des Services aufgerufen
-                werden:
-            </para>
-
-            <programlisting language="php"><![CDATA[
-$client = Zend_Gdata_ClientLogin::getHttpClient('user@gmail.com',
-                                                'pa$$word',
-                                                'health');
-$healthService = new Zend_Gdata_Health($client);
-$feed = $healthService->getHealthProfileListFeed();
-
-// Jeden Namen und jede ID des Profils ausgeben
-$entries = $feed->getEntries();
-foreach ($entries as $entry) {
-    echo '<p>Profil Name: ' . $entry->getProfileName() . '<br>';
-    echo 'Profil ID: ' . $entry->getProfileID() . '</p>';
-}
-]]></programlisting>
-
-            <para>
-                Sobald man sich entschieden hat welches Profil verwendet werden soll, wird
-                <methodname>setProfileID()</methodname> mit der Profil ID als Argument aufgerufen.
-                Das begrenzt die weiteren <acronym>API</acronym> Abfragen auf genau das betreffende
-                Profil:
-            </para>
-
-            <programlisting language="php"><![CDATA[
-// Verwende das erste Profil
-$profileID = $feed->entry[0]->getProfileID();
-$healthService->setProfileID($profileID);
-
-$profileFeed = $healthService->getHealthProfileFeed();
-
-$profileID = $healthService->getProfileID();
-echo '<p><b>Abgefragte Profil ID</b>: ' . $profileID . '</p>';
-]]></programlisting>
-        </sect3>
-    </sect2>
-
-    <sect2 id="zend.gdata.health.notice">
-        <title>Notizen an des Register Feed versenden</title>
-
-        <para>
-            Individuelle Antworten zum registrierten Feed sind als Notizen bekannt. Notizen werden
-            von Dritt-Anwendungen gesendet um den Benutzer über ein neues Event zu informieren. Mit
-            AuthSub/OAuth, sind Notizen einfach etwas womit die eigene Anwendung neue CCR
-            Informationen zu einem Benutzerprofil hinzufügen kann. Notizen können reinen Text
-            enthalten (inklusive einiger <acronym>XHTML</acronym> Elemente), ein CCR Dokument oder
-            beides. Als Beispiel können Notizen gesendet werden um Benutzer daran zu erinnern das
-            Sie spezielle Rezepte nehmen sollen, oder sie können Laborergebnisse im CCR Format
-            enthalten.
-        </para>
-
-        <sect3 id="zend.gdata.health.notice.send">
-            <title>Senden einer Notiz</title>
-
-            <para>
-                Notizen können durch das Verwenden der <methodname>sendHealthNotice()</methodname>
-                Methode des Health Services gesendet werden:
-            </para>
-
-            <programlisting language="php"><![CDATA[
-$healthService = new Zend_Gdata_Health($client);
-
-$subject = "Der Titel der Notiz ist hier";
-$body = "Der Notizinhalt kann einige <b>html</b> Elemente enthalten";
-$ccr = '<ContinuityOfCareRecord xmlns="urn:astm-org:CCR">
-  <Body>
-   <Problems>
-    <Problem>
-      <DateTime>
-        <Type><Text>Start Datum</Text></Type>
-        <ExactDateTime>2007-04-04T07:00:00Z</ExactDateTime>
-      </DateTime>
-      <Description>
-        <Text>Medikament gegen Aorta Verengung</Text>
-        <Code>
-          <Value>410.10</Value>
-          <CodingSystem>ICD9</CodingSystem>
-          <Version>2004</Version>
-        </Code>
-      </Description>
-      <Status><Text>Aktiv</Text></Status>
-    </Problem>
-  </Problems>
-  </Body>
-</ContinuityOfCareRecord>';
-
-$responseEntry = $healthService->sendHealthNotice($subject,
-                                                  $body,
-                                                  "html",
-                                                  $ccr);
-]]></programlisting>
-        </sect3>
-    </sect2>
-</sect1>

+ 0 - 5
documentation/manual/en/manual.xml.in

@@ -1076,11 +1076,6 @@
                     <xi:include href="../en/module_specs/Zend_Gdata_Docs.xml" />
                 </xi:fallback>
             </xi:include>
-            <xi:include href="module_specs/Zend_Gdata_Health.xml">
-                <xi:fallback>
-                    <xi:include href="../en/module_specs/Zend_Gdata_Health.xml" />
-                </xi:fallback>
-            </xi:include>
             <xi:include href="module_specs/Zend_Gdata_Spreadsheets.xml">
                 <xi:fallback>
                     <xi:include href="../en/module_specs/Zend_Gdata_Spreadsheets.xml" />

+ 0 - 528
documentation/manual/en/module_specs/Zend_Gdata_Health.xml

@@ -1,528 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- Reviewed: no -->
-<sect1 id="zend.gdata.health">
-    <title>Using Google Health</title>
-
-    <para>
-        The Google Health Data <acronym>API</acronym> is designed to enable developers to do two
-        things:
-
-        <itemizedlist>
-            <listitem>
-                <para>
-                    Read a user's Google Health profile or query for medical records that match
-                    particular criteria and then use the results to provide personalized
-                    functionality based on the data.
-                </para>
-            </listitem>
-
-            <listitem>
-                <para>
-                    Add new medical records to a user's profile by including CCR data when sending a
-                    notice to a user's profile. Note: The CCR data is stored as an
-                    <acronym>XML</acronym> blob within the &lt;atom&gt; entry. The library does not
-                    provide direct accessors to the object model but it does have helpers for
-                    extracting specific fields.
-                </para>
-            </listitem>
-        </itemizedlist>
-    </para>
-
-    <para>
-        There are three main feeds, each of which requires authentication. Unlike other Google Data
-        <acronym>API</acronym>s, each Google Health feed has a limited set of
-        <acronym>HTTP</acronym> operations you can perform on it, depending on which authentication
-        method you are using (ClientLogin or AuthSub/OAuth). For a list of permitted operations, see
-        <ulink
-            url="http://code.google.com/apis/health/reference.html#Authentication">http://code.google.com/apis/health/reference.html#Authentication</ulink>.
-
-        <itemizedlist>
-            <listitem>
-                <para>
-                  <firstterm>Profile Feed</firstterm>
-                  use the profile feed to query a user's health profile for specific information.
-                </para>
-            </listitem>
-
-            <listitem>
-                <para>
-                  <firstterm>Register Feed</firstterm>
-                  use the register feed to reconcile new CCR data into a profile.
-                </para>
-            </listitem>
-
-            <listitem>
-                <para>
-                  <firstterm>Profile List Feed</firstterm> the profile list feed should be used to
-                  determine which of the user's Health profiles to interact with. This feed is only
-                  available when using ClientLogin.
-                </para>
-            </listitem>
-        </itemizedlist>
-    </para>
-
-    <para>
-        See <ulink
-            url="http://code.google.com/apis/health/">http://code.google.com/apis/health</ulink>
-        for more information about the Google Health <acronym>API</acronym>.
-    </para>
-
-    <sect2 id="zend.gdata.health.connect">
-        <title>Connect To The Health Service</title>
-
-        <para>
-            The Google Health <acronym>API</acronym>, like all Google Data <acronym>API</acronym>s,
-            is based off of the Atom Publishing Protocol (APP), an <acronym>XML</acronym> based
-            format for managing web-based resources. Traffic between a client and the Google Health
-            servers occurs over <acronym>HTTP</acronym> and allows for authenticated connections.
-        </para>
-
-        <para>
-            Before any transactions can occur, a connection needs to be made. Creating a connection
-            to the Health servers involves two steps: creating an <acronym>HTTP</acronym> client and
-            binding a <classname>Zend_Gdata_Health</classname> service instance to that client.
-        </para>
-
-        <sect3 id="zend.gdata.health.connect.authentication">
-            <title>Authentication</title>
-
-            <para>
-                The Google Health <acronym>API</acronym> allows programmatic access to a user's
-                Health profile. There are three authentication schemes that are supported by Google
-                Health:
-            </para>
-
-            <itemizedlist>
-                <listitem>
-                    <para>
-                        <firstterm>ClientLogin</firstterm> provides direct username/password
-                        authentication to the Health servers. Since this method requires that users
-                        provide your application with their password, this authentication scheme is
-                        only recommended for installed/desktop applications.
-                    </para>
-                </listitem>
-
-                <listitem>
-                    <para>
-                        <firstterm>AuthSub</firstterm> allows a user to authorize the sharing of
-                        their private data. This provides the same level of convenience as
-                        ClientLogin but without the security risk, making it an ideal choice for
-                        web-based applications. For Google Health, AuthSub must be used in
-                        registered and secure mode--meaning that all requests to the
-                        <acronym>API</acronym> must be digitally signed.
-                    </para>
-                </listitem>
-
-                <listitem>
-                    <para>
-                        <firstterm>OAuth</firstterm> is an alternative to AuthSub. Although this
-                        authentication scheme is not discussed in this document, more information
-                        can be found in the <ulink
-                            url="http://code.google.com/apis/health/developers_guide_protocol.html#OAuth">Health
-                            Data <acronym>API</acronym> Developer's Guide</ulink>.
-                    </para>
-                </listitem>
-            </itemizedlist>
-
-            <para>
-                See <ulink
-                    url="http://code.google.com/apis/gdata/auth.html">Authentication Overview in the
-                    Google Data <acronym>API</acronym> documentation</ulink> for more
-                information on each authentication method.
-            </para>
-        </sect3>
-
-        <sect3 id="zend.gdata.health.connect.service">
-            <title>Create A Health Service Instance</title>
-
-            <para>
-                In order to interact with Google Health, the client library provides the
-                <classname>Zend_Gdata_Health</classname> service class. This class provides a common
-                interface to the Google Data and Atom Publishing Protocol models and assists in
-                marshaling requests to and from the Health <acronym>API</acronym>.
-            </para>
-
-            <para>
-                Once you've decided on an authentication scheme, the next step is to create an
-                instance of <classname>Zend_Gdata_Health</classname>. This class should be passed an
-                instance of <classname>Zend_Gdata_HttpClient</classname>. This provides an interface
-                for AuthSub/OAuth and ClientLogin to create a special authenticated
-                <acronym>HTTP</acronym> client.
-            </para>
-
-            <para>
-                To test against the H9 Developer's (/h9) instead of Google Health (/health), the
-                <classname>Zend_Gdata_Health</classname> constructor takes an optional third
-                argument for you to specify the H9 service name 'weaver'.
-            </para>
-
-            <para>
-                The example below shows how to create a Health service class using ClientLogin
-                authentication:
-            </para>
-
-            <programlisting language="php"><![CDATA[
-// Parameters for ClientLogin authentication
-$healthServiceName = Zend_Gdata_Health::HEALTH_SERVICE_NAME;
-//$h9ServiceName = Zend_Gdata_Health::H9_SANDBOX_SERVICE_NAME;
-$user = "user@gmail.com";
-$pass = "pa$$w0rd";
-
-// Create an authenticated HTTP client
-$client = Zend_Gdata_ClientLogin::getHttpClient($user,
-                                                $pass,
-                                                $healthServiceName);
-
-// Create an instance of the Health service
-$service = new Zend_Gdata_Health($client);
-]]></programlisting>
-
-            <para>
-                A Health service using AuthSub can be created in a similar, though slightly more
-                lengthy fashion. AuthSub is the recommend interface to communicate with Google
-                Health because each token is directly linked to a specific profile in the user's
-                account. Unlike other Google Data <acronym>API</acronym>s, it is required that all
-                requests from your application be digitally signed.
-            </para>
-
-            <programlisting language="php"><![CDATA[
-/*
- * Retrieve the current URL so that the AuthSub server knows where to
- * redirect the user after authentication is complete.
- */
-function getCurrentUrl() {
-    $phpRequestUri = htmlentities(substr($_SERVER['REQUEST_URI'],
-                                         0,
-                                         strcspn($_SERVER['REQUEST_URI'],
-                                                 "\n\r")),
-                                  ENT_QUOTES);
-
-    if (isset($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) == 'on') {
-        $protocol = 'https://';
-    } else {
-        $protocol = 'http://';
-    }
-    $host = $_SERVER['HTTP_HOST'];
-    if ($_SERVER['SERVER_PORT'] != '' &&
-       (($protocol == 'http://' && $_SERVER['SERVER_PORT'] != '80') ||
-       ($protocol == 'https://' && $_SERVER['SERVER_PORT'] != '443'))) {
-        $port = ':' . $_SERVER['SERVER_PORT'];
-    } else {
-        $port = '';
-    }
-    return $protocol . $host . $port . $phpRequestUri;
-}
-
-/*
- * Redirect a user to AuthSub if they do not have a valid session token.
- * If they're coming back from AuthSub with a single-use token, instantiate
- * a new HTTP client and exchange the token for a long-lived session token
- * instead.
- */
-function setupClient($singleUseToken = null) {
-    $client = null;
-
-    // Fetch a new AuthSub token?
-    if (!$singleUseToken) {
-        $next = getCurrentUrl();
-        $scope = 'https://www.google.com/health/feeds';
-        $authSubHandler = 'https://www.google.com/health/authsub';
-        $secure = 1;
-        $session = 1;
-        $authSubURL =  Zend_Gdata_AuthSub::getAuthSubTokenUri($next,
-                                                              $scope,
-                                                              $secure,
-                                                              $session,
-                                                              $authSubHandler);
-
-         // 1 - allows posting notices && allows reading profile data
-        $permission = 1;
-        $authSubURL .= '&permission=' . $permission;
-
-        echo '<a href="' . $authSubURL . '">Your Google Health Account</a>';
-    } else {
-        $client = new Zend_Gdata_HttpClient();
-
-        // This sets your private key to be used to sign subsequent requests
-        $client->setAuthSubPrivateKeyFile('/path/to/your/rsa_private_key.pem',
-                                          null,
-                                          true);
-
-        $sessionToken =
-            Zend_Gdata_AuthSub::getAuthSubSessionToken(trim($singleUseToken),
-                                                       $client);
-
-        // Set the long-lived session token for subsequent requests
-        $client->setAuthSubToken($sessionToken);
-    }
-    return $client;
-}
-
-// -> Script execution begins here <-
-
-session_start();
-
-$client = setupClient(@$_GET['token']);
-
-// Create an instance of the Health service
-$userH9Sandbox = false;
-$healthService = new Zend_Gdata_Health($client,
-                                       'googleInc-MyTestAppName-v1.0',
-                                       $userH9Sandbox);
-]]></programlisting>
-
-            <para>
-                NOTE: the remainder of this document will assume you are using AuthSub for
-                authentication.
-            </para>
-        </sect3>
-    </sect2>
-
-    <sect2 id="zend.gdata.health.profilefeed">
-        <title>Profile Feed</title>
-
-        <para>
-            To query the user's profile feed, make sure your initial AuthSub token was requested
-            with the <property>permission</property> parameter set to <emphasis>1</emphasis>. The
-            process of extracting data from the profile requires two steps, sending a query and
-            iterating through the resulting feed.
-        </para>
-
-        <sect3 id="zend.gdata.health.profilefeed.query">
-            <title>Send a Structured Query</title>
-
-            <para>
-                You can send structured queries to retrieve specific records from a user's profile.
-            </para>
-
-            <para>
-                When retrieving the profile using the Health <acronym>API</acronym>, specifically
-                constructed query <acronym>URL</acronym>s are used to describe what (CCR) data
-                should be returned. The <classname>Zend_Gdata_Health_Query</classname> class helps
-                simplify this task by automatically constructing a query <acronym>URL</acronym>
-                based on the parameters you set.
-            </para>
-
-            <sect4 id="zend.gdata.health.profilefeed.query.construct">
-                <title>Query The Feed</title>
-
-                <para>
-                    To execute a query against the profile feed, invoke a new instance of an
-                    <classname>Zend_Gdata_Health_Query</classname> and call the service's
-                    <methodname>getHealthProfileFeed()</methodname> method:
-                </para>
-
-                <programlisting language="php"><![CDATA[
-$healthService = new Zend_Gdata_Health($client);
-
-// example query for the top 10 medications with 2 items each
-$query = new Zend_Gdata_Health_Query();
-$query->setDigest("true");
-$query->setGrouped("true");
-$query->setMaxResultsGroup(10);
-$query->setMaxResultsInGroup(2);
-$query->setCategory("medication");
-
-$profileFeed = $healthService->getHealthProfileFeed($query);
-]]></programlisting>
-
-                <para>
-                    Using <methodname>setDigest("true")</methodname> returns all of user's CCR data
-                    in a single Atom <emphasis>&lt;entry&gt;</emphasis>.
-                </para>
-
-                <para>
-                    The <methodname>setCategory()</methodname> helper can be passed an additional
-                    parameter to return more specific CCR information. For example, to return just
-                    the medication Lipitor, use
-                    <methodname>setCategory("medication", "Lipitor")</methodname>. The same
-                    methodology can be applied to other categories such as conditions, allergies,
-                    lab results, etc.
-                </para>
-
-                <para>
-                    A full list of supported query parameters is available in the <ulink
-                        url="http://code.google.com/apis/health/reference.html#Parameters">query
-                        parameters section</ulink> of the Health <acronym>API</acronym> Reference
-                    Guide.
-                </para>
-            </sect4>
-        </sect3>
-
-        <sect3 id="zend.gdata.health.profilefeed.iterate">
-            <title>Iterate Through The Profile Entries</title>
-
-            <para>
-                Each Google Health entry contains CCR data, however, using the
-                <property>digest</property> query parameter and setting is to
-                <constant>TRUE</constant> will consolidate all of the CCR elements
-                (that match your query) into a single Atom <emphasis>&lt;entry&gt;</emphasis>.
-            </para>
-
-            <para>
-                To retrieve the full CCR information from an entry, make a call to the
-                <classname>Zend_Gdata_Health_ProfileEntry</classname> class's
-                <methodname>getCcr()</methodname> method. That returns a
-                <classname>Zend_Gdata_Health_Extension_CCR</classname>:
-            </para>
-
-            <programlisting language="php"><![CDATA[
-$entries = $profileFeed->getEntries();
-foreach ($entries as $entry) {
-    $medications = $entry->getCcr()->getMedications();
-    //$conditions = $entry->getCcr()->getConditions();
-    //$immunizations = $entry->getCcr()->getImmunizations();
-
-    // print the CCR xml (this will just be the entry's medications)
-    foreach ($medications as $med) {
-        $xmlStr = $med->ownerDocument->saveXML($med);
-        echo "<pre>" . $xmlStr . "</pre>";
-    }
-}
-]]></programlisting>
-
-            <para>
-                Here, the <methodname>getCcr()</methodname> method is used in conjunction with a
-                magic helper to drill down and extract just the medication data from the entry's
-                CCR. The formentioned magic helper takes the form
-                <methodname>getCATEGORYNAME()</methodname>, where <constant>CATEGORYNAME</constant>
-                is a supported Google Health category. See the <ulink
-                    url="http://code.google.com/apis/health/reference.html#CatQueries">Google Health
-                    reference Guide</ulink> for the possible categories.
-            </para>
-
-            <para>
-                To be more efficient, you can also use category queries to only return the necessary
-                CCR from the Google Health servers. Then, iterate through those results:
-            </para>
-
-            <programlisting language="php"><![CDATA[
-$query = new Zend_Gdata_Health_Query();
-$query->setDigest("true");
-$query->setCategory("condition");
-$profileFeed = $healthService->getHealthProfileFeed($query);
-
-// Since the query contained digest=true, only one Atom entry is returned
-$entry = $profileFeed->entry[0];
-$conditions = $entry->getCcr()->getConditions();
-
-// print the CCR xml (this will just be the profile's conditions)
-foreach ($conditions as $cond) {
-    $xmlStr = $cond->ownerDocument->saveXML($cond);
-    echo "<pre>" . $xmlStr . "</pre>";
-}
-]]></programlisting>
-        </sect3>
-    </sect2>
-
-    <sect2 id="zend.gdata.health.profilelist">
-        <title>Profile List Feed</title>
-
-        <para>NOTE: This feed is only available when using ClientLogin</para>
-
-        <para>
-            Since ClientLogin requires a profile ID with each of its feeds, applications will likely
-            want to query this feed first in order to select the appropriate profile. The profile
-            list feed returns Atom entries corresponding each profile in the user's Google Health
-            account. The profile ID is returned in the Atom <emphasis>&lt;content&gt;</emphasis> and
-            the profile name in the <emphasis>&lt;title&gt;</emphasis> element.
-        </para>
-
-        <sect3 id="zend.gdata.health.profilelist.query">
-            <title>Query The Feed</title>
-
-            <para>
-                To execute a query against the profile list feed, call the service's
-                <methodname>getHealthProfileListFeed()</methodname> method:
-            </para>
-
-            <programlisting language="php"><![CDATA[
-$client = Zend_Gdata_ClientLogin::getHttpClient('user@gmail.com',
-                                                'pa$$word',
-                                                'health');
-$healthService = new Zend_Gdata_Health($client);
-$feed = $healthService->getHealthProfileListFeed();
-
-// print each profile's name and id
-$entries = $feed->getEntries();
-foreach ($entries as $entry) {
-    echo '<p>Profile name: ' . $entry->getProfileName() . '<br>';
-    echo 'profile ID: ' . $entry->getProfileID() . '</p>';
-}
-]]></programlisting>
-
-            <para>
-                Once you've determined which profile to use, call
-                <methodname>setProfileID()</methodname> with the profileID as an argument. This will
-                restrict subsequent <acronym>API</acronym> requests to be against that particular
-                profile:
-            </para>
-
-            <programlisting language="php"><![CDATA[
-// use the first profile
-$profileID = $feed->entry[0]->getProfileID();
-$healthService->setProfileID($profileID);
-
-$profileFeed = $healthService->getHealthProfileFeed();
-
-$profileID = $healthService->getProfileID();
-echo '<p><b>Queried profileID</b>: ' . $profileID . '</p>';
-]]></programlisting>
-        </sect3>
-    </sect2>
-
-    <sect2 id="zend.gdata.health.notice">
-        <title>Sending Notices to the Register Feed</title>
-
-        <para>
-            Individual posts to the register feed are known as notices. Notice are sent from
-            third-party applications to inform the user of a new event. With AuthSub/OAuth, notices
-            are the single means by which your application can add new CCR information into a user's
-            profile. Notices can contain plain text (including certain <acronym>XHTML</acronym>
-            elements), a CCR document, or both. As an example, notices might be sent to remind users
-            to pick up a prescription, or they might contain lab results in the CCR format.
-        </para>
-
-        <sect3 id="zend.gdata.health.notice.send">
-            <title>Sending a notice</title>
-
-            <para>
-                Notices can be sent by using the <methodname>sendHealthNotice()</methodname> method
-                for the Health service:
-            </para>
-
-            <programlisting language="php"><![CDATA[
-$healthService = new Zend_Gdata_Health($client);
-
-$subject = "Title of your notice goes here";
-$body = "Notice body can contain <b>html</b> entities";
-$ccr = '<ContinuityOfCareRecord xmlns="urn:astm-org:CCR">
-  <Body>
-   <Problems>
-    <Problem>
-      <DateTime>
-        <Type><Text>Start date</Text></Type>
-        <ExactDateTime>2007-04-04T07:00:00Z</ExactDateTime>
-      </DateTime>
-      <Description>
-        <Text>Aortic valve disorders</Text>
-        <Code>
-          <Value>410.10</Value>
-          <CodingSystem>ICD9</CodingSystem>
-          <Version>2004</Version>
-        </Code>
-      </Description>
-      <Status><Text>Active</Text></Status>
-    </Problem>
-  </Problems>
-  </Body>
-</ContinuityOfCareRecord>';
-
-$responseEntry = $healthService->sendHealthNotice($subject,
-                                                  $body,
-                                                  "html",
-                                                  $ccr);
-]]></programlisting>
-        </sect3>
-    </sect2>
-</sect1>

+ 9 - 194
library/Zend/Gdata/Health.php

@@ -22,29 +22,14 @@
  */
 
 /**
- * @see Zend_Gdata
- */
-require_once 'Zend/Gdata.php';
-
-/**
- * @see Zend_Gdata_Health_ProfileFeed
+ * @see Zend_Exception
  */
-require_once 'Zend/Gdata/Health/ProfileFeed.php';
+require_once 'Zend/Exception.php';
 
 /**
- * @see Zend_Gdata_Health_ProfileListFeed
- */
-require_once 'Zend/Gdata/Health/ProfileListFeed.php';
-
-/**
- * @see Zend_Gdata_Health_ProfileListEntry
- */
-require_once 'Zend/Gdata/Health/ProfileListEntry.php';
-
-/**
- * @see Zend_Gdata_Health_ProfileEntry
+ * @see Zend_Gdata
  */
-require_once 'Zend/Gdata/Health/ProfileEntry.php';
+require_once 'Zend/Gdata.php';
 
 /**
  * Service class for interacting with the Google Health Data API
@@ -84,29 +69,6 @@ class Zend_Gdata_Health extends Zend_Gdata
     const H9_SANDBOX_SERVICE_NAME = 'weaver';
 
     /**
-     * Profile ID used for all API interactions.  This can only be set when
-     * using ClientLogin for authentication.
-     *
-     * @var string
-     */
-    private $_profileID = null;
-
-    /**
-     * True if API calls should be made to the H9 developer sandbox at /h9
-     * rather than /health
-     *
-     * @var bool
-     */
-    private $_useH9Sandbox = false;
-
-    public static $namespaces =
-        array('ccr' => 'urn:astm-org:CCR',
-              'batch' => 'http://schemas.google.com/gdata/batch',
-              'h9m' => 'http://schemas.google.com/health/metadata',
-              'gAcl' => 'http://schemas.google.com/acl/2007',
-              'gd' => 'http://schemas.google.com/g/2005');
-
-    /**
      * Create Zend_Gdata_Health object
      *
      * @param Zend_Http_Client $client (optional) The HTTP client to use when
@@ -118,157 +80,10 @@ class Zend_Gdata_Health extends Zend_Gdata
      */
     public function __construct($client = null, $applicationId = 'MyCompany-MyApp-1.0', $useH9Sandbox = false)
     {
-        $this->registerPackage('Zend_Gdata_Health');
-        $this->registerPackage('Zend_Gdata_Health_Extension_Ccr');
-        parent::__construct($client, $applicationId);
-        $this->_useH9Sandbox = $useH9Sandbox;
-    }
-
-    /**
-     * Gets the id of the user's profile
-     *
-     * @return string The profile id
-     */
-    public function getProfileID()
-    {
-        return $this->_profileID;
-    }
-
-    /**
-     * Sets which of the user's profiles will be used
-     *
-     * @param string $id The profile ID
-     * @return Zend_Gdata_Health Provides a fluent interface
-     */
-    public function setProfileID($id) {
-        $this->_profileID = $id;
-        return $this;
-    }
-
-     /**
-     * Retrieves the list of profiles associated with the user's ClientLogin
-     * credentials.
-     *
-     * @param string $query The query of the feed as a URL or Query object
-     * @return Zend_Gdata_Feed
-     */
-    public function getHealthProfileListFeed($query = null)
-    {
-        if ($this->_httpClient->getClientLoginToken() === null) {
-            require_once 'Zend/Gdata/App/AuthException.php';
-            throw new Zend_Gdata_App_AuthException(
-                'Profiles list feed is only available when using ClientLogin');
-        }
-
-        if($query === null)  {
-            $uri = self::CLIENTLOGIN_PROFILELIST_FEED_URI;
-        } else if ($query instanceof Zend_Gdata_Query) {
-            $uri = $query->getQueryUrl();
-        } else {
-            $uri = $query;
-        }
-
-        // use correct feed for /h9 or /health
-        if ($this->_useH9Sandbox) {
-            $uri = preg_replace('/\/health\//', '/h9/', $uri);
-        }
-
-        return parent::getFeed($uri, 'Zend_Gdata_Health_ProfileListFeed');
-    }
-
-    /**
-     * Retrieve a user's profile as a feed object.  If ClientLogin is used, the
-     * profile associated with $this->_profileID is returned, otherwise
-     * the profile associated with the AuthSub token is read.
-     *
-     * @param mixed $query The query for the feed, as a URL or Query
-     * @return Zend_Gdata_Health_ProfileFeed
-     */
-    public function getHealthProfileFeed($query = null)
-    {
-        if ($this->_httpClient->getClientLoginToken() !== null &&
-            $this->getProfileID() == null) {
-            require_once 'Zend/Gdata/App/AuthException.php';
-            throw new Zend_Gdata_App_AuthException(
-                'Profile ID must not be null. Did you call setProfileID()?');
-        }
-
-        if ($query instanceof Zend_Gdata_Query) {
-            $uri = $query->getQueryUrl();
-        } else if ($this->_httpClient->getClientLoginToken() !== null &&
-                   $query == null) {
-            $uri = self::CLIENTLOGIN_PROFILE_FEED_URI . '/' . $this->getProfileID();
-        } else if ($query === null) {
-            $uri = self::AUTHSUB_PROFILE_FEED_URI;
-        } else {
-            $uri = $query;
-        }
-
-        // use correct feed for /h9 or /health
-        if ($this->_useH9Sandbox) {
-            $uri = preg_replace('/\/health\//', '/h9/', $uri);
-        }
-
-        return parent::getFeed($uri, 'Zend_Gdata_Health_ProfileFeed');
-    }
-
-    /**
-     * Retrieve a profile entry object
-     *
-     * @param mixed $query The query for the feed, as a URL or Query
-     * @return Zend_Gdata_Health_ProfileEntry
-     */
-    public function getHealthProfileEntry($query = null)
-    {
-        if ($query === null) {
-            require_once 'Zend/Gdata/App/InvalidArgumentException.php';
-            throw new Zend_Gdata_App_InvalidArgumentException(
-                'Query must not be null');
-        } else if ($query instanceof Zend_Gdata_Query) {
-            $uri = $query->getQueryUrl();
-        } else {
-            $uri = $query;
-        }
-        return parent::getEntry($uri, 'Zend_Gdata_Health_ProfileEntry');
-    }
-
-    /**
-     * Posts a new notice using the register feed.  This function constructs
-     * the atom profile entry.
-     *
-     * @param string $subject The subject line of the notice
-     * @param string $body The message body of the notice
-     * @param string $bodyType The (optional) type of message body
-     *     (text, xhtml, html, etc.)
-     * @param string $ccrXML The (optional) CCR to add to the user's profile
-     * @return Zend_Gdata_Health_ProfileEntry
-     */
-    public function sendHealthNotice($subject, $body, $bodyType = null, $ccrXML = null)
-    {
-        if ($this->_httpClient->getClientLoginToken()) {
-            $profileID = $this->getProfileID();
-            if ($profileID !== null) {
-                $uri = self::CLIENTLOGIN_REGISTER_FEED_URI . '/' . $profileID;
-            } else {
-                require_once 'Zend/Gdata/App/AuthException.php';
-                throw new Zend_Gdata_App_AuthException(
-                    'Profile ID must not be null. Did you call setProfileID()?');
-            }
-        } else {
-            $uri = self::AUTHSUB_REGISTER_FEED_URI;
-        }
-
-        $entry = new Zend_Gdata_Health_ProfileEntry();
-        $entry->title = $this->newTitle($subject);
-        $entry->content = $this->newContent($body);
-        $entry->content->type = $bodyType ? $bodyType : 'text';
-        $entry->setCcr($ccrXML);
-
-        // use correct feed for /h9 or /health
-        if ($this->_useH9Sandbox) {
-            $uri = preg_replace('/\/health\//', '/h9/', $uri);
-        }
-
-        return $this->insertEntry($entry, $uri, 'Zend_Gdata_Health_ProfileEntry');
+        throw new Zend_Exception(
+            'Google Health API has been discontinued by Google and was removed'
+            . ' from Zend Framework in 1.12.0.  For more information see: '
+            . 'http://googleblog.blogspot.ca/2011/06/update-on-google-health-and-google.html'
+        );
     }
 }

+ 10 - 76
library/Zend/Gdata/Health/Extension/Ccr.php

@@ -21,6 +21,11 @@
  */
 
 /**
+ * @see Zend_Exception
+ */
+require_once 'Zend/Exception.php';
+
+/**
  * @see Zend_Gdata_App_Extension_Element
  */
 require_once 'Zend/Gdata/App/Extension/Element.php';
@@ -36,10 +41,6 @@ require_once 'Zend/Gdata/App/Extension/Element.php';
  */
 class Zend_Gdata_Health_Extension_Ccr extends Zend_Gdata_App_Extension_Element
 {
-    protected $_rootNamespace = 'ccr';
-    protected $_rootElement = 'ContinuityOfCareRecord';
-    protected $_ccrDom = null;
-
     /**
      * Creates a Zend_Gdata_Health_Extension_Ccr entry, representing CCR data
      *
@@ -48,77 +49,10 @@ class Zend_Gdata_Health_Extension_Ccr extends Zend_Gdata_App_Extension_Element
      */
     public function __construct($element = null)
     {
-        foreach (Zend_Gdata_Health::$namespaces as $nsPrefix => $nsUri) {
-            $this->registerNamespace($nsPrefix, $nsUri);
-        }
-    }
-
-    /**
-     * Transfers each child and attribute into member variables.
-     * This is called when XML is received over the wire and the data
-     * model needs to be built to represent this XML.
-     *
-     * @param DOMNode $node The DOMNode that represents this object's data
-     */
-    public function transferFromDOM($node)
-    {
-        $this->_ccrDom = $node;
-    }
-
-    /**
-     * Retrieves a DOMElement which corresponds to this element and all
-     * child properties.  This is used to build an entry back into a DOM
-     * and eventually XML text for sending to the server upon updates, or
-     * for application storage/persistence.
-     *
-     * @param DOMDocument $doc The DOMDocument used to construct DOMElements
-     * @return DOMElement The DOMElement representing this element and all
-     * child properties.
-     */
-    public function getDOM($doc = null, $majorVersion = 1, $minorVersion = null)
-    {
-        if ($doc === null) {
-            $doc = new DOMDocument('1.0', 'utf-8');
-        }
-        $domElement = $doc->importNode($this->_ccrDom, true);
-        return $domElement;
-    }
-
-    /**
-     * Magic helper that allows drilling down and returning specific elements
-     * in the CCR. For example, to retrieve the users medications
-     * (/ContinuityOfCareRecord/Body/Medications) from the entry's CCR, call
-     * $entry->getCcr()->getMedications().  Similarly, getConditions() would
-     * return extract the user's conditions.
-     *
-     * @param string $name Name of the function to call
-     * @param unknown $args
-     * @return array.<DOMElement> A list of the appropriate CCR data
-     */
-    public function __call($name, $args)
-    {
-        if (substr($name, 0, 3) === 'get') {
-            $category = substr($name, 3);
-
-            switch ($category) {
-                case 'Conditions':
-                    $category = 'Problems';
-                    break;
-                case 'Allergies':
-                    $category = 'Alerts';
-                    break;
-                case 'TestResults':
-                    // TestResults is an alias for LabResults
-                case 'LabResults':
-                    $category = 'Results';
-                    break;
-                default:
-                    // $category is already well formatted
-            }
-
-            return $this->_ccrDom->getElementsByTagNameNS($this->lookupNamespace('ccr'), $category);
-        } else {
-            return null;
-        }
+        throw new Zend_Exception(
+            'Google Health API has been discontinued by Google and was removed'
+            . ' from Zend Framework in 1.12.0.  For more information see: '
+            . 'http://googleblog.blogspot.ca/2011/06/update-on-google-health-and-google.html'
+        );
     }
 }

+ 9 - 85
library/Zend/Gdata/Health/ProfileEntry.php

@@ -22,14 +22,14 @@
  */
 
 /**
- * @see Zend_Gdata_Entry
+ * @see Zend_Exception
  */
-require_once 'Zend/Gdata/Entry.php';
+require_once 'Zend/Exception.php';
 
 /**
- * @see Zend_Gdata_Health_Extension_Ccr
+ * @see Zend_Gdata_Entry
  */
-require_once 'Zend/Gdata/Health/Extension/Ccr.php';
+require_once 'Zend/Gdata/Entry.php';
 
 /**
  * Concrete class for working with Health profile entries.
@@ -45,91 +45,15 @@ require_once 'Zend/Gdata/Health/Extension/Ccr.php';
 class Zend_Gdata_Health_ProfileEntry extends Zend_Gdata_Entry
 {
     /**
-     * The classname for individual profile entry elements.
-     *
-     * @var string
-     */
-    protected $_entryClassName = 'Zend_Gdata_Health_ProfileEntry';
-
-    /**
-     * Google Health CCR data
-     *
-     * @var Zend_Gdata_Health_Extension_Ccr
-     */
-    protected $_ccrData = null;
-
-    /**
      * Constructs a new Zend_Gdata_Health_ProfileEntry object.
      * @param DOMElement $element (optional) The DOMElement on which to base this object.
      */
     public function __construct($element = null)
     {
-        foreach (Zend_Gdata_Health::$namespaces as $nsPrefix => $nsUri) {
-            $this->registerNamespace($nsPrefix, $nsUri);
-        }
-        parent::__construct($element);
-    }
-
-    /**
-     * Retrieves a DOMElement which corresponds to this element and all
-     * child properties.  This is used to build an entry back into a DOM
-     * and eventually XML text for application storage/persistence.
-     *
-     * @param DOMDocument $doc The DOMDocument used to construct DOMElements
-     * @return DOMElement The DOMElement representing this element and all
-     *          child properties.
-     */
-    public function getDOM($doc = null, $majorVersion = 1, $minorVersion = null)
-    {
-        $element = parent::getDOM($doc, $majorVersion, $minorVersion);
-        if ($this->_ccrData !== null) {
-          $element->appendChild($this->_ccrData->getDOM($element->ownerDocument));
-        }
-
-        return $element;
-    }
-
-    /**
-     * Creates individual Entry objects of the appropriate type and
-     * stores them as members of this entry based upon DOM data.
-     *
-     * @param DOMNode $child The DOMNode to process
-     */
-    protected function takeChildFromDOM($child)
-    {
-        $absoluteNodeName = $child->namespaceURI . ':' . $child->localName;
-
-        if (strstr($absoluteNodeName, $this->lookupNamespace('ccr') . ':')) {
-            $ccrElement = new Zend_Gdata_Health_Extension_Ccr();
-            $ccrElement->transferFromDOM($child);
-            $this->_ccrData = $ccrElement;
-        } else {
-            parent::takeChildFromDOM($child);
-
-        }
-    }
-
-    /**
-     * Sets the profile entry's CCR data
-     * @param string $ccrXMLStr The CCR as an xml string
-     * @return Zend_Gdata_Health_Extension_Ccr
-     */
-    public function setCcr($ccrXMLStr) {
-        $ccrElement = null;
-        if ($ccrXMLStr != null) {
-          $ccrElement = new Zend_Gdata_Health_Extension_Ccr();
-          $ccrElement->transferFromXML($ccrXMLStr);
-          $this->_ccrData = $ccrElement;
-        }
-        return $ccrElement;
-    }
-
-
-    /**
-     * Returns all the CCR data in a profile entry
-     * @return Zend_Gdata_Health_Extension_Ccr
-     */
-    public function getCcr() {
-        return $this->_ccrData;
+        throw new Zend_Exception(
+            'Google Health API has been discontinued by Google and was removed'
+            . ' from Zend Framework in 1.12.0.  For more information see: '
+            . 'http://googleblog.blogspot.ca/2011/06/update-on-google-health-and-google.html'
+        );
     }
 }

+ 10 - 16
library/Zend/Gdata/Health/ProfileFeed.php

@@ -22,6 +22,11 @@
  */
 
 /**
+ * @see Zend_Exception
+ */
+require_once 'Zend/Exception.php';
+
+/**
  * @see Zend_Gdata_Feed
  */
 require_once 'Zend/Gdata/Feed.php';
@@ -40,13 +45,6 @@ require_once 'Zend/Gdata/Feed.php';
 class Zend_Gdata_Health_ProfileFeed extends Zend_Gdata_Feed
 {
     /**
-     * The class name for individual profile feed elements.
-     *
-     * @var string
-     */
-    protected $_entryClassName = 'Zend_Gdata_Health_ProfileEntry';
-
-    /**
      * Creates a Health Profile feed, representing a user's Health profile
      *
      * @param DOMElement $element (optional) DOMElement from which this
@@ -54,14 +52,10 @@ class Zend_Gdata_Health_ProfileFeed extends Zend_Gdata_Feed
      */
     public function __construct($element = null)
     {
-        foreach (Zend_Gdata_Health::$namespaces as $nsPrefix => $nsUri) {
-            $this->registerNamespace($nsPrefix, $nsUri);
-        }
-        parent::__construct($element);
-    }
-
-    public function getEntries()
-    {
-        return $this->entry;
+        throw new Zend_Exception(
+            'Google Health API has been discontinued by Google and was removed'
+            . ' from Zend Framework in 1.12.0.  For more information see: '
+            . 'http://googleblog.blogspot.ca/2011/06/update-on-google-health-and-google.html'
+        );
     }
 }

+ 10 - 51
library/Zend/Gdata/Health/ProfileListEntry.php

@@ -22,6 +22,11 @@
  */
 
 /**
+ * @see Zend_Exception
+ */
+require_once 'Zend/Exception.php';
+
+/**
  * @see Zend_Gdata_Entry
  */
 require_once 'Zend/Gdata/Entry.php';
@@ -40,61 +45,15 @@ require_once 'Zend/Gdata/Entry.php';
 class Zend_Gdata_Health_ProfileListEntry extends Zend_Gdata_Entry
 {
     /**
-     * The classname for individual profile list entry elements.
-     *
-     * @var string
-     */
-    protected $_entryClassName = 'Zend_Gdata_Health_ProfileListEntry';
-
-    /**
      * Constructs a new Zend_Gdata_Health_ProfileListEntry object.
      * @param DOMElement $element (optional) The DOMElement on which to base this object.
      */
     public function __construct($element = null)
     {
-        parent::__construct($element);
+        throw new Zend_Exception(
+            'Google Health API has been discontinued by Google and was removed'
+            . ' from Zend Framework in 1.12.0.  For more information see: '
+            . 'http://googleblog.blogspot.ca/2011/06/update-on-google-health-and-google.html'
+        );
     }
-
-    /**
-     * Retrieves a DOMElement which corresponds to this element and all
-     * child properties.  This is used to build an entry back into a DOM
-     * and eventually XML text for application storage/persistence.
-     *
-     * @param DOMDocument $doc The DOMDocument used to construct DOMElements
-     * @return DOMElement The DOMElement representing this element and all
-     *          child properties.
-     */
-    public function getDOM($doc = null, $majorVersion = 1, $minorVersion = null)
-    {
-        $element = parent::getDOM($doc, $majorVersion, $minorVersion);
-        return $element;
-    }
-
-    /**
-     * Creates individual Entry objects of the appropriate type and
-     * stores them as members of this entry based upon DOM data.
-     *
-     * @param DOMNode $child The DOMNode to process
-     */
-    protected function takeChildFromDOM($child)
-    {
-        parent::takeChildFromDOM($child);
-    }
-
-    /**
-     * Retrieves the profile ID for the entry, which is contained in <atom:content>
-     * @return string The profile id
-     */
-    public function getProfileID() {
-        return $this->getContent()->text;
-    }
-
-    /**
-     * Retrieves the profile's title, which is contained in <atom:title>
-     * @return string The profile name
-     */
-    public function getProfileName() {
-        return $this->getTitle()->text;
-    }
-
 }

+ 11 - 9
library/Zend/Gdata/Health/ProfileListFeed.php

@@ -22,6 +22,11 @@
  */
 
 /**
+ * @see Zend_Exception
+ */
+require_once 'Zend/Exception.php';
+
+/**
  * @see Zend_Gdata_Feed
  */
 require_once 'Zend/Gdata/Feed.php';
@@ -39,15 +44,12 @@ require_once 'Zend/Gdata/Feed.php';
  */
 class Zend_Gdata_Health_ProfileListFeed extends Zend_Gdata_Feed
 {
-    /**
-     * The class name for individual profile feed elements.
-     *
-     * @var string
-     */
-    protected $_entryClassName = 'Zend_Gdata_Health_ProfileListEntry';
-
-    public function getEntries()
+    public function __construct($element = null)
     {
-        return $this->entry;
+        throw new Zend_Exception(
+            'Google Health API has been discontinued by Google and was removed'
+            . ' from Zend Framework in 1.12.0.  For more information see: '
+            . 'http://googleblog.blogspot.ca/2011/06/update-on-google-health-and-google.html'
+        );
     }
 }

+ 13 - 223
library/Zend/Gdata/Health/Query.php

@@ -22,6 +22,11 @@
  */
 
 /**
+ * @see Zend_Exception
+ */
+require_once 'Zend/Exception.php';
+
+/**
  * @see Zend_Gdata_Query
  */
 require_once('Zend/Gdata/Query.php');
@@ -55,231 +60,16 @@ class Zend_Gdata_Health_Query extends Zend_Gdata_Query
      * Namespace for an item category
      */
     const ITEM_CATEGORY_NS = 'http://schemas.google.com/health/item';
-
-    /**
-     * The default URI for POST methods
-     *
-     * @var string
-     */
-    protected $_defaultFeedUri = self::HEALTH_PROFILE_FEED_URI;
-
-    /**
-     * Sets the digest parameter's value.
-     *
-     * @param string $value
-     * @return Zend_Gdata_Health_Query Provides a fluent interface
-     */
-    public function setDigest($value)
-    {
-        if ($value !== null) {
-            $this->_params['digest'] = $value;
-        }
-        return $this;
-    }
-
-    /**
-     * Returns the digest parameter's value.
-     *
-     * @return string The value set for the digest parameter.
-     */
-    public function getDigest()
-    {
-        if (array_key_exists('digest', $this->_params)) {
-            return $this->_params['digest'];
-        } else {
-            return null;
-        }
-    }
-
-    /**
-     * Setter for category queries.
-     *
-     * @param string $item A category to query.
-     * @param string $name (optional) A specific item to search a category for.
-     *     An example would be 'Lipitor' if $item is set to 'medication'.
-     * @return Zend_Gdata_Health_Query Provides a fluent interface
-     */
-    public function setCategory($item, $name = null)
-    {
-        $this->_category = $item .
-            ($name ? '/' . urlencode('{' . self::ITEM_CATEGORY_NS . '}' . $name) : null);
-        return $this;
-    }
-
-    /**
-     * Returns the query object's category.
-     *
-     * @return string id
-     */
-    public function getCategory()
-    {
-        return $this->_category;
-    }
-
-    /**
-     * Setter for the grouped parameter.
-     *
-     * @param string $value setting a count of results per group.
-     * @return Zend_Gdata_Health_Query Provides a fluent interface
-     */
-    public function setGrouped($value)
-    {
-        if ($value !== null) {
-            $this->_params['grouped'] = $value;
-        }
-        return $this;
-    }
-
-    /**
-     * Returns the value set for the grouped parameter.
-     *
-     * @return string grouped parameter.
-     */
-    public function getGrouped()
-    {
-        if (array_key_exists('grouped', $this->_params)) {
-            return $this->_params['grouped'];
-        } else {
-            return null;
-        }
-    }
-
-    /**
-     * Setter for the max-results-group parameter.
-     *
-     * @param int $value Specifies the maximum number of groups to be
-     *     retrieved. Must be an integer value greater than zero. This parameter
-     *     is only valid if grouped=true.
-     * @return Zend_Gdata_Health_Query Provides a fluent interface
-     */
-    public function setMaxResultsGroup($value)
-    {
-        if ($value !== null) {
-            if ($value <= 0 || $this->getGrouped() !== 'true') {
-                require_once 'Zend/Gdata/App/InvalidArgumentException.php';
-                throw new Zend_Gdata_App_InvalidArgumentException(
-                    'The max-results-group parameter must be set to a value
-                    greater than 0 and can only be used if grouped=true');
-            } else {
-              $this->_params['max-results-group'] = $value;
-            }
-        }
-        return $this;
-    }
-
-    /**
-     *  Returns the value set for max-results-group.
-     *
-     * @return int Returns max-results-group parameter.
-     */
-    public function getMaxResultsGroup()
-    {
-        if (array_key_exists('max-results-group', $this->_params)) {
-            return $this->_params['max-results-group'];
-        } else {
-            return null;
-        }
-    }
-
-    /**
-     *  Setter for the max-results-group parameter.
-     *
-     * @param int $value Specifies the maximum number of records to be
-     *     retrieved from each group.  The limits that you specify with this
-     *     parameter apply to all groups. Must be an integer value greater than
-     *     zero. This parameter is only valid if grouped=true.
-     * @return Zend_Gdata_Health_Query Provides a fluent interface
-     */
-    public function setMaxResultsInGroup($value)
-    {
-        if ($value !== null) {
-            if ($value <= 0 || $this->getGrouped() !== 'true') {
-              throw new Zend_Gdata_App_InvalidArgumentException(
-                  'The max-results-in-group parameter must be set to a value
-                  greater than 0 and can only be used if grouped=true');
-            } else {
-              $this->_params['max-results-in-group'] = $value;
-            }
-        }
-        return $this;
-    }
-
-    /**
-     *  Returns the value set for max-results-in-group.
-     *
-     * @return int Returns max-results-in-group parameter.
-     */
-    public function getMaxResultsInGroup()
-    {
-        if (array_key_exists('max-results-in-group', $this->_params)) {
-            return $this->_params['max-results-in-group'];
-        } else {
-            return null;
-        }
-    }
-
-    /**
-     * Setter for the start-index-group parameter.
-     *
-     * @param int $value Retrieves only items whose group ranking is at
-     *     least start-index-group. This should be set to a 1-based index of the
-     *     first group to be retrieved. The range is applied per category.
-     *     This parameter is only valid if grouped=true.
-     * @return Zend_Gdata_Health_Query Provides a fluent interface
-     */
-    public function setStartIndexGroup($value)
-    {
-        if ($value !== null && $this->getGrouped() !== 'true') {
-            throw new Zend_Gdata_App_InvalidArgumentException(
-                'The start-index-group can only be used if grouped=true');
-        } else {
-          $this->_params['start-index-group'] = $value;
-        }
-        return $this;
-    }
-
-    /**
-     *  Returns the value set for start-index-group.
-     *
-     * @return int Returns start-index-group parameter.
-     */
-    public function getStartIndexGroup()
-    {
-        if (array_key_exists('start-index-group', $this->_params)) {
-            return $this->_params['start-index-group'];
-        } else {
-            return null;
-        }
-    }
-
-    /**
-     *  Setter for the start-index-in-group parameter.
-     *
-     * @param int $value  A 1-based index of the records to be retrieved from
-     *     each group. This parameter is only valid if grouped=true.
-     * @return Zend_Gdata_Health_Query Provides a fluent interface
-     */
-    public function setStartIndexInGroup($value)
-    {
-        if ($value !== null && $this->getGrouped() !== 'true') {
-            throw new Zend_Gdata_App_InvalidArgumentException('start-index-in-group');
-        } else {
-          $this->_params['start-index-in-group'] = $value;
-        }
-        return $this;
-    }
-
+    
     /**
-     * Returns the value set for start-index-in-group.
-     *
-     * @return int Returns start-index-in-group parameter.
+     * Create Gdata_Query object
      */
-    public function getStartIndexInGroup()
+    public function __construct($url = null)
     {
-        if (array_key_exists('start-index-in-group', $this->_params)) {
-            return $this->_params['start-index-in-group'];
-        } else {
-            return null;
-        }
+        throw new Zend_Exception(
+            'Google Health API has been discontinued by Google and was removed'
+            . ' from Zend Framework in 1.12.0.  For more information see: '
+            . 'http://googleblog.blogspot.ca/2011/06/update-on-google-health-and-google.html'
+        );
     }
 }

+ 0 - 6
tests/TestConfiguration.php.dist

@@ -301,12 +301,6 @@ defined('TESTS_ZEND_GDATA_DOCS_ONLINE_ENABLED') || define('TESTS_ZEND_GDATA_DOCS
  */
 defined('TESTS_ZEND_GDATA_PHOTOS_ONLINE_ENABLED') || define('TESTS_ZEND_GDATA_PHOTOS_ONLINE_ENABLED', false);
 
-/*
- * This indicates that online tests for the Google Health API should
- * be performed.
- */
-defined('TESTS_ZEND_GDATA_HEALTH_ONLINE_ENABLED') || define('TESTS_ZEND_GDATA_HEALTH_ONLINE_ENABLED', false);
-
 /**
  * Zend_Http_Client tests
  *

+ 0 - 17
tests/Zend/Gdata/AllTests.php

@@ -174,18 +174,12 @@ require_once 'Zend/Gdata/Books/CollectionEntryTest.php';
 require_once 'Zend/Gdata/Books/VolumeFeedTest.php';
 require_once 'Zend/Gdata/Books/VolumeEntryTest.php';
 
-require_once 'Zend/Gdata/Health/QueryTest.php';
-require_once 'Zend/Gdata/Health/ProfileListEntryTest.php';
-require_once 'Zend/Gdata/Health/ProfileEntryTest.php';
-require_once 'Zend/Gdata/Health/ProfileFeedTest.php';
-
 /**
  * Tests that do require online access to servers
  * and authentication credentials
  */
 require_once 'Zend/Gdata/GdataOnlineTest.php';
 require_once 'Zend/Gdata/CalendarOnlineTest.php';
-require_once 'Zend/Gdata/HealthOnlineTest.php';
 require_once 'Zend/Gdata/SpreadsheetsOnlineTest.php';
 require_once 'Zend/Gdata/DocsOnlineTest.php';
 require_once 'Zend/Gdata/PhotosOnlineTest.php';
@@ -358,11 +352,6 @@ class Zend_Gdata_AllTests
         $suite->addTestSuite('Zend_Gdata_Books_VolumeEntryTest');
         $suite->addTestSuite('Zend_Gdata_Books_VolumeFeedTest');
 
-        $suite->addTestSuite('Zend_Gdata_Health_QueryTest');
-        $suite->addTestSuite('Zend_Gdata_Health_ProfileListEntryTest');
-        $suite->addTestSuite('Zend_Gdata_Health_ProfileEntryTest');
-        $suite->addTestSuite('Zend_Gdata_Health_ProfileFeedTest');
-
         $skippingOnlineTests = true;
         if (defined('TESTS_ZEND_GDATA_ONLINE_ENABLED') &&
             constant('TESTS_ZEND_GDATA_ONLINE_ENABLED') == true &&
@@ -402,12 +391,6 @@ class Zend_Gdata_AllTests
             constant('TESTS_ZEND_GDATA_BOOKS_ONLINE_ENABLED') == true) {
                 $suite->addTestSuite('Zend_Gdata_BooksOnlineTest');
             }
-
-            if (defined('TESTS_ZEND_GDATA_HEALTH_ONLINE_ENABLED') &&
-            constant('TESTS_ZEND_GDATA_HEALTH_ONLINE_ENABLED') == true) {
-                $suite->addTestSuite('Zend_Gdata_HealthOnlineTest');
-            }
-
         }
         if (defined('TESTS_ZEND_GDATA_ONLINE_ENABLED') &&
                    constant('TESTS_ZEND_GDATA_ONLINE_ENABLED') == true) {

+ 0 - 142
tests/Zend/Gdata/Health/ProfileEntryTest.php

@@ -1,142 +0,0 @@
-<?php
-/**
- * Zend Framework
- *
- * LICENSE
- *
- * This source file is subject to the new BSD license that is bundled
- * with this package in the file LICENSE.txt.
- * It is also available through the world-wide-web at this URL:
- * http://framework.zend.com/license/new-bsd
- * If you did not receive a copy of the license and are unable to
- * obtain it through the world-wide-web, please send an email
- * to license@zend.com so we can send you a copy immediately.
- *
- * @category   Zend
- * @package    Zend_Gdata_Health
- * @subpackage UnitTests
- * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
- * @license    http://framework.zend.com/license/new-bsd     New BSD License
- * @version    $Id $
- */
-
-require_once 'Zend/Gdata/Health.php';
-require_once 'Zend/Gdata/Health/ProfileEntry.php';
-
-/**
- * @category   Zend
- * @package    Zend_Gdata_Health
- * @subpackage UnitTests
- * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
- * @license    http://framework.zend.com/license/new-bsd     New BSD License
- * @group      Zend_Gdata
- * @group      Zend_Gdata_Health
- */
-class Zend_Gdata_Health_ProfileEntryTest extends PHPUnit_Framework_TestCase
-{
-
-    public function setUp()
-    {
-        $this->entry = new Zend_Gdata_Health_ProfileEntry();
-        $this->entryText = file_get_contents(
-            'Zend/Gdata/Health/_files/TestDataHealthProfileEntrySample.xml',
-            true);
-    }
-
-    public function testEmptyProfileEntry()
-    {
-        $this->assertTrue(is_array($this->entry->extensionElements));
-        $this->assertTrue(count($this->entry->extensionElements) == 0);
-        $this->assertTrue($this->entry->getCcr() === null);
-    }
-
-    public function testEmptyProfileEntryToAndFromStringShouldMatch() {
-        $this->entry->transferFromXML($this->entryText);
-        $entryXml = $this->entry->saveXML();
-        $newProfileEntry = new Zend_Gdata_Health_ProfileEntry();
-        $newProfileEntry->transferFromXML($entryXml);
-        $newProfileEntryXML = $newProfileEntry->saveXML();
-        $this->assertTrue($entryXml == $newProfileEntryXML);
-    }
-
-    public function testGetAllCcrFromProfileEntry()
-    {
-        $this->entry->transferFromXML($this->entryText);
-        $ccr = $this->entry->getCcr();
-        $this->assertTrue($ccr instanceof Zend_Gdata_Health_Extension_Ccr);
-        $this->assertXmlStringEqualsXmlString(file_get_contents(
-            'Zend/Gdata/Health/_files/TestDataHealthProfileEntrySample_just_ccr.xml', true), $ccr->getXML());
-    }
-
-    public function testSetCcrInProfileEntry()
-    {
-        $this->entry->transferFromXML($this->entryText);
-        $ccrXML = file_get_contents(
-            'Zend/Gdata/Health/_files/TestDataHealthProfileEntrySample_just_ccr.xml', true);
-        $ccrElement = $this->entry->setCcr($ccrXML);
-        $this->assertTrue($ccrElement instanceof Zend_Gdata_Health_Extension_Ccr);
-        $this->assertXmlStringEqualsXmlString(file_get_contents(
-            'Zend/Gdata/Health/_files/TestDataHealthProfileEntrySample_just_ccr.xml', true), $this->entry->getCcr()->getXML());
-    }
-
-    /*
-     *  These functions test the magic _call method within Zend_Gdata_Health_Extension_Ccr
-     */
-    public function testGetCcrMedicationsFromProfileEntry()
-    {
-        $this->entry->transferFromXML($this->entryText);
-        $medications = $this->entry->getCcr()->getMedications();
-        $this->assertEquals(1, count($medications));
-        foreach ($medications as $med) {
-          $this->assertXmlStringEqualsXmlString(file_get_contents(
-              "Zend/Gdata/Health/_files/TestDataHealthProfileEntrySample_medications_all.xml", true),
-              $med->ownerDocument->saveXML($med));
-        }
-    }
-
-    public function testGetCcrConditionsFromProfileEntry()
-    {
-        $this->entry->transferFromXML($this->entryText);
-        $problems = $this->entry->getCcr()->getProblems();
-        $conditions = $this->entry->getCcr()->getConditions();
-        $this->assertEquals($problems, $conditions);
-
-        $this->assertEquals(1, count($conditions));
-        foreach ($conditions as $index => $condition) {
-            $this->assertXmlStringEqualsXmlString(file_get_contents(
-                "Zend/Gdata/Health/_files/TestDataHealthProfileEntrySample_condition_all.xml", true),
-                $condition->ownerDocument->saveXML($condition));
-        }
-    }
-
-    public function testGetCcrAllerigiesFromProfileEntry()
-    {
-        $this->entry->transferFromXML($this->entryText);
-        $allergies = $this->entry->getCcr()->getAllergies();
-        $alerts = $this->entry->getCcr()->getAlerts();
-        $this->assertEquals($allergies, $alerts);
-
-        $this->assertEquals(1, count($alerts));
-        foreach ($alerts as $index => $alert) {
-            $this->assertXmlStringEqualsXmlString(file_get_contents(
-                "Zend/Gdata/Health/_files/TestDataHealthProfileEntrySample_allergy_all.xml", true),
-                $alert->ownerDocument->saveXML($alert));
-        }
-    }
-
-    public function testGetCcrLabResultsFromProfileEntry()
-    {
-        $this->entry->transferFromXML($this->entryText);
-        $labresults = $this->entry->getCcr()->getLabResults();
-        $results = $this->entry->getCcr()->getResults();
-        $this->assertEquals($labresults, $results);
-
-        $this->assertEquals(1, count($results));
-        foreach ($results as $index => $result) {
-            $this->assertXmlStringEqualsXmlString(file_get_contents(
-                "Zend/Gdata/Health/_files/TestDataHealthProfileEntrySample_results0.xml", true),
-                $result->ownerDocument->saveXML($result));
-        }
-    }
-}
-

+ 0 - 124
tests/Zend/Gdata/Health/ProfileFeedTest.php

@@ -1,124 +0,0 @@
-<?php
-/**
- * Zend Framework
- *
- * LICENSE
- *
- * This source file is subject to the new BSD license that is bundled
- * with this package in the file LICENSE.txt.
- * It is also available through the world-wide-web at this URL:
- * http://framework.zend.com/license/new-bsd
- * If you did not receive a copy of the license and are unable to
- * obtain it through the world-wide-web, please send an email
- * to license@zend.com so we can send you a copy immediately.
- *
- * @category   Zend
- * @package    Zend_Gdata_Health
- * @subpackage UnitTests
- * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
- * @license    http://framework.zend.com/license/new-bsd     New BSD License
- * @version    $Id $
- */
-
-require_once 'Zend/Gdata/Health.php';
-require_once 'Zend/Gdata/Health/ProfileFeed.php';
-require_once 'Zend/Gdata/Health/ProfileEntry.php';
-
-/**
- * @category   Zend
- * @package    Zend_Gdata_Health
- * @subpackage UnitTests
- * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
- * @license    http://framework.zend.com/license/new-bsd     New BSD License
- * @group      Zend_Gdata
- * @group      Zend_Gdata_Health
- */
-class Zend_Gdata_Health_ProfileFeedTest extends PHPUnit_Framework_TestCase
-{
-
-    public function setUp()
-    {
-        $this->profileFeed = new Zend_Gdata_Health_ProfileFeed();
-        $this->feedText = file_get_contents(
-            'Zend/Gdata/Health/_files/TestDataHealthProfileFeedSample.xml', true);
-    }
-
-    private function verifyAllSamplePropertiesAreCorrect($profileFeed) {
-        $this->assertEquals('https://www.google.com/health/feeds/profile/default', $profileFeed->id->text);
-        $this->assertEquals('2008-09-30T01:07:17.888Z', $profileFeed->updated->text);
-        $this->assertEquals('http://schemas.google.com/g/2005#kind', $profileFeed->category[0]->scheme);
-        $this->assertEquals('http://schemas.google.com/health/kinds#profile', $profileFeed->category[0]->term);
-        $this->assertEquals('text', $profileFeed->title->type);
-        $this->assertEquals('Profile Feed', $profileFeed->title->text);
-        $this->assertEquals('self', $profileFeed->getLink('self')->rel);
-        $this->assertEquals('application/atom+xml', $profileFeed->getLink('self')->type);
-        $this->assertEquals('https://www.google.com/health/feeds/profile/default?digest=false',
-            $profileFeed->getLink('self')->href);
-        $this->assertEquals(1, $profileFeed->startIndex->text);
-    }
-
-    public function testAllSamplePropertiesAreCorrect() {
-        $this->profileFeed->transferFromXML($this->feedText);
-        $this->verifyAllSamplePropertiesAreCorrect($this->profileFeed);
-    }
-
-    public function testToAndFromXMLString()
-    {
-        $this->assertEquals(0, count($this->profileFeed->entry));
-
-        $this->profileFeed->transferFromXML($this->feedText);
-        $this->assertEquals(15, count($this->profileFeed->entry));
-        foreach($this->profileFeed->entry as $entry)
-        {
-            $this->assertTrue($entry instanceof Zend_Gdata_Health_ProfileEntry);
-        }
-
-        $newProfileFeed = new Zend_Gdata_Health_ProfileFeed();
-        $doc = new DOMDocument();
-        $doc->loadXML($this->profileFeed->saveXML());
-        $newProfileFeed->transferFromDom($doc->documentElement);
-
-        $this->assertEquals(15, count($newProfileFeed->entry));
-        foreach($newProfileFeed->entry as $entry)
-        {
-            $this->assertTrue($entry instanceof Zend_Gdata_Health_ProfileEntry);
-        }
-    }
-
-
-    public function testGetEntries()
-    {
-        $this->profileFeed->transferFromXML($this->feedText);
-        $entries = $this->profileFeed->getEntries();
-        $this->assertTrue(is_array($entries));
-        $this->assertEquals(15, count($entries));
-    }
-
-    public function testGetAllCcrFromProfileEntries()
-    {
-        $newProfileFeed = new Zend_Gdata_Health_ProfileFeed();
-        $newProfileFeed->transferFromXML($this->feedText);
-        foreach($newProfileFeed->entry as $entry)
-        {
-            $ccr = $entry->getCcr();
-            $this->assertTrue($ccr instanceof Zend_Gdata_Health_Extension_Ccr);
-        }
-    }
-
-    public function testGetFirstEntrysCcrMedication()
-    {
-        $this->profileFeed->transferFromXML($this->feedText);
-
-        $medications = $this->profileFeed->entry[0]->getCcr()->getMedications();
-        $this->assertType('DOMNodeList', $medications);
-        $this->assertEquals(1, count($medications));
-
-        foreach ($medications as $med) {
-          $xmlStr = $med->ownerDocument->saveXML($med);
-          $this->assertXmlStringEqualsXmlString(file_get_contents(
-              'Zend/Gdata/Health/_files/TestDataHealthProfileEntrySample_medications3.xml', true),
-              $xmlStr);
-        }
-    }
-}
-

+ 0 - 64
tests/Zend/Gdata/Health/ProfileListEntryTest.php

@@ -1,64 +0,0 @@
-<?php
-/**
- * Zend Framework
- *
- * LICENSE
- *
- * This source file is subject to the new BSD license that is bundled
- * with this package in the file LICENSE.txt.
- * It is also available through the world-wide-web at this URL:
- * http://framework.zend.com/license/new-bsd
- * If you did not receive a copy of the license and are unable to
- * obtain it through the world-wide-web, please send an email
- * to license@zend.com so we can send you a copy immediately.
- *
- * @category   Zend
- * @package    Zend_Gdata_Health
- * @subpackage UnitTests
- * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
- * @license    http://framework.zend.com/license/new-bsd     New BSD License
- * @version    $Id $
- */
-
-require_once 'Zend/Gdata/Health.php';
-require_once 'Zend/Gdata/Health/ProfileListEntry.php';
-
-/**
- * @category   Zend
- * @package    Zend_Gdata_Health
- * @subpackage UnitTests
- * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
- * @license    http://framework.zend.com/license/new-bsd     New BSD License
- * @group      Zend_Gdata
- * @group      Zend_Gdata_Health
- */
-class Zend_Gdata_Health_ProfileListEntryTest extends PHPUnit_Framework_TestCase
-{
-
-    public function setUp()
-    {
-        $this->entry = new Zend_Gdata_Health_ProfileListEntry();
-        $this->entryText = file_get_contents(
-            'Zend/Gdata/Health/_files/TestDataHealthProfileListEntrySample.xml', true);
-    }
-
-    public function testEmptyProfileEntryToAndFromStringShouldMatch() {
-        $this->entry->transferFromXML($this->entryText);
-        $entryXml = $this->entry->saveXML();
-        $newProfileListEntry = new Zend_Gdata_Health_ProfileListEntry();
-        $newProfileListEntry->transferFromXML($entryXml);
-        $newProfileListEntryXML = $newProfileListEntry->saveXML();
-        $this->assertTrue($entryXml == $newProfileListEntryXML);
-    }
-
-    public function testGetProfileID() {
-        $this->entry->transferFromXML($this->entryText);
-        $this->assertEquals('vndCn5sdfwdEIY', $this->entry->getProfileID());
-    }
-
-    public function testGetProfileName() {
-        $this->entry->transferFromXML($this->entryText);
-        $this->assertEquals('profile name', $this->entry->getProfileName());
-    }
-}
-

+ 0 - 154
tests/Zend/Gdata/Health/QueryTest.php

@@ -1,154 +0,0 @@
-<?php
-/**
- * Zend Framework
- *
- * LICENSE
- *
- * This source file is subject to the new BSD license that is bundled
- * with this package in the file LICENSE.txt.
- * It is also available through the world-wide-web at this URL:
- * http://framework.zend.com/license/new-bsd
- * If you did not receive a copy of the license and are unable to
- * obtain it through the world-wide-web, please send an email
- * to license@zend.com so we can send you a copy immediately.
- *
- * @category   Zend
- * @package    Zend_Gdata_Health
- * @subpackage UnitTests
- * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
- * @license    http://framework.zend.com/license/new-bsd     New BSD License
- * @version    $Id $
- */
-
-require_once 'Zend/Gdata/Health.php';
-require_once 'Zend/Gdata/Health/Query.php';
-require_once 'Zend/Http/Client.php';
-
-/**
- * @category   Zend
- * @package    Zend_Gdata_Health
- * @subpackage UnitTests
- * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
- * @license    http://framework.zend.com/license/new-bsd     New BSD License
- * @group      Zend_Gdata
- * @group      Zend_Gdata_Health
- */
-class Zend_Gdata_Health_QueryTest extends PHPUnit_Framework_TestCase
-{
-
-    public function setUp()
-    {
-        $this->query = new Zend_Gdata_Health_Query();
-    }
-
-    public function testDigest()
-    {
-        $this->query->resetParameters();
-        $this->assertEquals(null, $this->query->getDigest());
-        $this->query->setDigest('true');
-        $this->assertEquals('true', $this->query->getDigest());
-        $this->assertContains('digest=true', $this->query->getQueryUrl());
-    }
-
-    public function testCategory()
-    {
-        $this->query->resetParameters();
-        $this->query->setCategory('medication');
-        $this->assertEquals($this->query->getCategory(), 'medication');
-
-        $this->query->setCategory('medication', 'Lipitor');
-        $this->assertEquals($this->query->getCategory(), 'medication/%7Bhttp%3A%2F%2Fschemas.google.com%2Fhealth%2Fitem%7DLipitor');
-
-        $this->query->setCategory('condition', 'Malaria');
-        $this->assertEquals($this->query->getCategory(), 'condition/%7Bhttp%3A%2F%2Fschemas.google.com%2Fhealth%2Fitem%7DMalaria');
-    }
-
-    public function testGrouped()
-    {
-        $this->query->resetParameters();
-        $this->query->setGrouped('true');
-        $this->assertEquals('true', $this->query->getGrouped());
-        $this->assertContains('grouped=true', $this->query->getQueryUrl());
-    }
-
-    public function testMaxResultsGroup()
-    {
-        $this->query->resetParameters();
-
-        try {
-            $this->query->setMaxResultsGroup(1);
-            $this->fail('Expecting to catch Zend_Gdata_App_InvalidArgumentException');
-        } catch (Exception $e) {
-            $this->assertThat($e, $this->isInstanceOf('Zend_Gdata_App_InvalidArgumentException'),
-                'Expecting Zend_Gdata_App_InvalidArgumentException, got '.get_class($e));
-        }
-
-        $this->assertEquals(null, $this->query->getMaxResultsGroup());
-
-        $this->query->setGrouped('true');
-        $this->query->setMaxResultsGroup(1);
-        $this->assertEquals(1, $this->query->getMaxResultsGroup());
-        $this->assertContains('max-results-group=1', $this->query->getQueryUrl());
-    }
-
-    public function testMaxResultsInGroup()
-    {
-        $this->query->resetParameters();
-
-        try {
-            $this->query->setMaxResultsInGroup(2);
-            $this->fail('Expecting to catch Zend_Gdata_App_InvalidArgumentException');
-        } catch (Exception $e) {
-            $this->assertThat($e, $this->isInstanceOf('Zend_Gdata_App_InvalidArgumentException'),
-                'Expecting Zend_Gdata_App_InvalidArgumentException, got '.get_class($e));
-        }
-
-        $this->query->setGrouped('true');
-        $this->assertEquals(null, $this->query->getMaxResultsInGroup());
-        $this->query->setMaxResultsInGroup(2);
-        $this->assertEquals(2, $this->query->getMaxResultsInGroup());
-        $this->assertContains('max-results-in-group=2', $this->query->getQueryUrl());
-    }
-
-    public function testStartIndexGroup()
-    {
-        $this->query->resetParameters();
-
-        $this->assertEquals(null, $this->query->getStartIndexGroup());
-
-        try {
-            $this->query->setStartIndexGroup(3);
-            $this->fail('Expecting to catch Zend_Gdata_App_InvalidArgumentException');
-        } catch (Exception $e) {
-            $this->assertThat($e, $this->isInstanceOf('Zend_Gdata_App_InvalidArgumentException'),
-                'Expecting Zend_Gdata_App_InvalidArgumentException, got '.get_class($e));
-        }
-
-        $this->query->setGrouped('true');
-        $this->query->setStartIndexGroup(3);
-        $this->assertEquals(3, $this->query->getStartIndexGroup());
-        $this->assertContains('start-index-group=3', $this->query->getQueryUrl());
-    }
-
-    public function testStartIndexInGroup()
-    {
-        $this->query->resetParameters();
-
-        $this->assertEquals(null, $this->query->getStartIndexInGroup());
-
-        try {
-            $this->query->setStartIndexInGroup(4);
-            $this->fail('Expecting to catch Zend_Gdata_App_InvalidArgumentException');
-        } catch (Exception $e) {
-            $this->assertThat($e, $this->isInstanceOf('Zend_Gdata_App_InvalidArgumentException'),
-                'Expecting Zend_Gdata_App_InvalidArgumentException, got '.get_class($e));
-        }
-
-        $this->query->setGrouped('true');
-        $this->query->setStartIndexInGroup(4);
-        $this->assertEquals(4, $this->query->getStartIndexInGroup());
-        $this->assertContains('start-index-in-group=4', $this->query->getQueryUrl());
-    }
-
-}
-

+ 0 - 559
tests/Zend/Gdata/Health/_files/TestDataHealthProfileEntrySample.xml

@@ -1,559 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<entry xmlns="http://www.w3.org/2005/Atom" xmlns:openSearch="http://a9.com/-/spec/opensearchrss/1.0/" xmlns:ccr="urn:astm-org:CCR" xmlns:batch="http://schemas.google.com/gdata/batch" xmlns:h9m="http://schemas.google.com/health/metadata">
-  <id>https://www.google.com/health/feeds/profile/default/vneCn5qdEIY_digest</id>
-  <updated>2008-09-29T07:52:17.176Z</updated>
-  <category scheme="http://schemas.google.com/g/2005#kind" term="http://schemas.google.com/health/kinds#profile" />
-  <link rel="alternate" type="application/atom+xml" href="https://www.google.com/health/feeds/profile/default?digest=true" />
-  <link rel="self" type="application/atom+xml" href="https://www.google.com/health/feeds/profile/default/vneCn5qdEIY_digest" />
-  <link rel="edit" type="application/atom+xml" href="https://www.google.com/health/feeds/profile/default/vneCn5qdEIY_digest" />
-  <ContinuityOfCareRecord xmlns="urn:astm-org:CCR">
-    <CCRDocumentObjectID>vneCn5qdEIY</CCRDocumentObjectID>
-    <Language>
-      <Text>English</Text>
-      <Code>
-        <Value>en</Value>
-        <CodingSystem>ISO-639-1</CodingSystem>
-      </Code>
-    </Language>
-    <Version>V1.0</Version>
-    <DateTime>
-      <ExactDateTime>2008-09-29T07:52:17.176Z</ExactDateTime>
-    </DateTime>
-    <Patient>
-      <ActorID>Google Health Profile</ActorID>
-    </Patient>
-    <Body>
-      <FunctionalStatus>
-        <Function>
-          <Type>
-            <Text>Pregnancy status</Text>
-          </Type>
-          <Description>
-            <Text>Not pregnant</Text>
-          </Description>
-          <Status />
-          <Source>
-            <Actor>
-              <ActorID>user@google.com</ActorID>
-              <ActorRole>
-                <Text>Patient</Text>
-              </ActorRole>
-            </Actor>
-          </Source>
-        </Function>
-        <Function>
-          <Type>
-            <Text>Breastfeeding status</Text>
-          </Type>
-          <Description>
-            <Text>Not breastfeeding</Text>
-          </Description>
-          <Status />
-          <Source>
-            <Actor>
-              <ActorID>user@gmail.com</ActorID>
-              <ActorRole>
-                <Text>Patient</Text>
-              </ActorRole>
-            </Actor>
-          </Source>
-        </Function>
-      </FunctionalStatus>
-      <Problems>
-        <Problem>
-          <CCRDataObjectID>Hn0FE0IlcY-FMFFgSTxkvA/CONDITION/0</CCRDataObjectID>
-          <DateTime>
-            <Type>
-              <Text>Start date</Text>
-            </Type>
-            <ExactDateTime>2007-04-04T07:00:00Z</ExactDateTime>
-          </DateTime>
-          <Description>
-            <Text>Aortic valve disorders</Text>
-            <Code>
-              <Value>410.10</Value>
-              <CodingSystem>ICD9</CodingSystem>
-              <Version>2004</Version>
-            </Code>
-          </Description>
-          <Status>
-            <Text>Active</Text>
-          </Status>
-          <Source>
-            <Actor>
-              <ActorID>example.com</ActorID>
-              <ActorRole>
-                <Text>Information Provider</Text>
-              </ActorRole>
-            </Actor>
-          </Source>
-        </Problem>
-        <Problem>
-          <Type />
-          <Description>
-            <Text>Malaria</Text>
-            <Code>
-              <Value>136.9</Value>
-              <CodingSystem>ICD9_Broader</CodingSystem>
-            </Code>
-            <Code>
-              <Value>084.6</Value>
-              <CodingSystem>ICD9</CodingSystem>
-            </Code>
-          </Description>
-          <Status>
-            <Text>ACTIVE</Text>
-          </Status>
-          <Source>
-            <Actor>
-              <ActorID>user@gmail.com</ActorID>
-              <ActorRole>
-                <Text>Patient</Text>
-              </ActorRole>
-            </Actor>
-          </Source>
-          <HealthStatus>
-            <Description />
-          </HealthStatus>
-        </Problem>
-      </Problems>
-      <SocialHistory>
-        <SocialHistoryElement>
-          <Type>
-            <Text>Race</Text>
-            <Code>
-              <Value>S15814</Value>
-              <CodingSystem>HL7</CodingSystem>
-            </Code>
-          </Type>
-          <Description>
-            <Text>White</Text>
-          </Description>
-          <Status />
-          <Source>
-            <Actor>
-              <ActorID>user@gmail.com</ActorID>
-              <ActorRole>
-                <Text>Patient</Text>
-              </ActorRole>
-            </Actor>
-          </Source>
-          <Episodes>
-            <Frequency>
-              <Units />
-            </Frequency>
-          </Episodes>
-        </SocialHistoryElement>
-      </SocialHistory>
-      <Alerts>
-        <Alert>
-          <Type>
-            <Text>Allergy</Text>
-          </Type>
-          <Description>
-            <Text>A-Fil</Text>
-          </Description>
-          <Status>
-            <Text>ACTIVE</Text>
-          </Status>
-          <Source>
-            <Actor>
-              <ActorID>user@gmail.com</ActorID>
-              <ActorRole>
-                <Text>Patient</Text>
-              </ActorRole>
-            </Actor>
-          </Source>
-          <Reaction>
-            <Description />
-            <Severity>
-              <Text>Severe</Text>
-            </Severity>
-          </Reaction>
-        </Alert>
-        <Alert>
-          <Type>
-            <Text>Allergy</Text>
-          </Type>
-          <Description>
-            <Text>A.E.R Traveler</Text>
-          </Description>
-          <Status>
-            <Text>ACTIVE</Text>
-          </Status>
-          <Source>
-            <Actor>
-              <ActorID>user@gmail.com</ActorID>
-              <ActorRole>
-                <Text>Patient</Text>
-              </ActorRole>
-            </Actor>
-          </Source>
-          <Reaction>
-            <Description />
-            <Severity>
-              <Text>Severe</Text>
-            </Severity>
-          </Reaction>
-        </Alert>
-      </Alerts>
-      <Medications>
-        <Medication>
-          <Type />
-          <Description />
-          <Status>
-            <Text>ACTIVE</Text>
-          </Status>
-          <Source>
-            <Actor>
-              <ActorID>user@gmail.com</ActorID>
-              <ActorRole>
-                <Text>Patient</Text>
-              </ActorRole>
-            </Actor>
-          </Source>
-          <Product>
-            <ProductName>
-              <Text>A&amp; D</Text>
-            </ProductName>
-            <Strength>
-              <Units />
-              <StrengthSequencePosition>0</StrengthSequencePosition>
-              <VariableStrengthModifier />
-            </Strength>
-          </Product>
-          <Directions>
-            <Direction>
-              <Description />
-              <DeliveryMethod />
-              <Dose>
-                <Units />
-                <DoseSequencePosition>0</DoseSequencePosition>
-                <VariableDoseModifier />
-              </Dose>
-              <Route>
-                <Text>To skin</Text>
-                <Code>
-                  <Value>C38305</Value>
-                  <CodingSystem>FDA</CodingSystem>
-                </Code>
-                <RouteSequencePosition>0</RouteSequencePosition>
-                <MultipleRouteModifier />
-              </Route>
-            </Direction>
-          </Directions>
-          <Refills />
-        </Medication>
-        <Medication>
-          <Type />
-          <Description />
-          <Status>
-            <Text>ACTIVE</Text>
-          </Status>
-          <Source>
-            <Actor>
-              <ActorID>user@gmail.com</ActorID>
-              <ActorRole>
-                <Text>Patient</Text>
-              </ActorRole>
-            </Actor>
-          </Source>
-          <Product>
-            <ProductName>
-              <Text>A-Fil</Text>
-            </ProductName>
-            <Strength>
-              <Units />
-              <StrengthSequencePosition>0</StrengthSequencePosition>
-              <VariableStrengthModifier />
-            </Strength>
-          </Product>
-          <Directions>
-            <Direction>
-              <Description />
-              <DeliveryMethod />
-              <Dose>
-                <Units />
-                <DoseSequencePosition>0</DoseSequencePosition>
-                <VariableDoseModifier />
-              </Dose>
-              <Route>
-                <Text>To skin</Text>
-                <Code>
-                  <Value>C38305</Value>
-                  <CodingSystem>FDA</CodingSystem>
-                </Code>
-                <RouteSequencePosition>0</RouteSequencePosition>
-                <MultipleRouteModifier />
-              </Route>
-            </Direction>
-          </Directions>
-          <Refills />
-        </Medication>
-        <Medication>
-          <Type />
-          <Description />
-          <Status>
-            <Text>ACTIVE</Text>
-          </Status>
-          <Source>
-            <Actor>
-              <ActorID>user@gmail.com</ActorID>
-              <ActorRole>
-                <Text>Patient</Text>
-              </ActorRole>
-            </Actor>
-          </Source>
-          <Product>
-            <ProductName>
-              <Text>Lipitor</Text>
-            </ProductName>
-            <Strength>
-              <Units />
-              <StrengthSequencePosition>0</StrengthSequencePosition>
-              <VariableStrengthModifier />
-            </Strength>
-          </Product>
-          <Directions>
-            <Direction>
-              <Description />
-              <DeliveryMethod />
-              <Dose>
-                <Units />
-                <DoseSequencePosition>0</DoseSequencePosition>
-                <VariableDoseModifier />
-              </Dose>
-              <Route>
-                <Text>By mouth</Text>
-                <Code>
-                  <Value>C38288</Value>
-                  <CodingSystem>FDA</CodingSystem>
-                </Code>
-                <RouteSequencePosition>0</RouteSequencePosition>
-                <MultipleRouteModifier />
-              </Route>
-            </Direction>
-          </Directions>
-          <Refills />
-        </Medication>
-      </Medications>
-      <Immunizations>
-        <Immunization>
-          <Type />
-          <Description />
-          <Status />
-          <Source>
-            <Actor>
-              <ActorID>user@gmail.com</ActorID>
-              <ActorRole>
-                <Text>Patient</Text>
-              </ActorRole>
-            </Actor>
-          </Source>
-          <Product>
-            <ProductName>
-              <Text>Chickenpox Vaccine</Text>
-              <Code>
-                <Value>21</Value>
-                <CodingSystem>HL7</CodingSystem>
-              </Code>
-            </ProductName>
-          </Product>
-          <Directions>
-            <Direction>
-              <Description />
-              <DeliveryMethod />
-            </Direction>
-          </Directions>
-          <Refills />
-        </Immunization>
-      </Immunizations>
-      <VitalSigns>
-        <Result>
-          <Type />
-          <Description />
-          <Status />
-          <Source>
-            <Actor>
-              <ActorID>user@gmail.com</ActorID>
-              <ActorRole>
-                <Text>Patient</Text>
-              </ActorRole>
-            </Actor>
-          </Source>
-          <Substance />
-          <Test>
-            <Type />
-            <Description>
-              <Text>Height</Text>
-            </Description>
-            <Status />
-            <TestResult>
-              <ResultSequencePosition>0</ResultSequencePosition>
-              <VariableResultModifier />
-              <Value>70</Value>
-              <Units>
-                <Unit>inches</Unit>
-              </Units>
-            </TestResult>
-            <ConfidenceValue />
-          </Test>
-        </Result>
-        <Result>
-          <Type />
-          <Description />
-          <Status />
-          <Source>
-            <Actor>
-              <ActorID>user@gmail.com</ActorID>
-              <ActorRole>
-                <Text>Patient</Text>
-              </ActorRole>
-            </Actor>
-          </Source>
-          <Substance />
-          <Test>
-            <Type />
-            <Description>
-              <Text>Weight</Text>
-            </Description>
-            <Status />
-            <TestResult>
-              <ResultSequencePosition>0</ResultSequencePosition>
-              <VariableResultModifier />
-              <Value>2480</Value>
-              <Units>
-                <Unit>ounces</Unit>
-              </Units>
-            </TestResult>
-            <ConfidenceValue />
-          </Test>
-        </Result>
-        <Result>
-          <Type />
-          <Description />
-          <Status />
-          <Source>
-            <Actor>
-              <ActorID>user@gmail.com</ActorID>
-              <ActorRole>
-                <Text>Patient</Text>
-              </ActorRole>
-            </Actor>
-          </Source>
-          <Substance />
-          <Test>
-            <Type />
-            <Description>
-              <Text>Blood Type</Text>
-            </Description>
-            <Status />
-            <TestResult>
-              <ResultSequencePosition>0</ResultSequencePosition>
-              <VariableResultModifier />
-              <Value>O+</Value>
-              <Units />
-            </TestResult>
-            <ConfidenceValue />
-          </Test>
-        </Result>
-      </VitalSigns>
-      <Results>
-        <Result>
-          <Type />
-          <Description />
-          <Status />
-          <Source>
-            <Actor>
-              <ActorID>user@gmail.com</ActorID>
-              <ActorRole>
-                <Text>Patient</Text>
-              </ActorRole>
-            </Actor>
-          </Source>
-          <Substance />
-          <Test>
-            <DateTime>
-              <Type>
-                <Text>Collection start date</Text>
-              </Type>
-              <ExactDateTime>2008-09-03</ExactDateTime>
-            </DateTime>
-            <Type />
-            <Description>
-              <Text>Acetaldehyde - Blood</Text>
-            </Description>
-            <Status />
-            <TestResult>
-              <ResultSequencePosition>0</ResultSequencePosition>
-              <VariableResultModifier />
-              <Units />
-            </TestResult>
-            <ConfidenceValue />
-          </Test>
-        </Result>
-      </Results>
-      <Procedures>
-        <Procedure>
-          <Type />
-          <Description>
-            <Text>Abdominal Ultrasound</Text>
-          </Description>
-          <Status />
-          <Source>
-            <Actor>
-              <ActorID>user@gmail.com</ActorID>
-              <ActorRole>
-                <Text>Patient</Text>
-              </ActorRole>
-            </Actor>
-          </Source>
-        </Procedure>
-        <Procedure>
-          <Type />
-          <Description>
-            <Text>Abdominoplasty</Text>
-          </Description>
-          <Status />
-          <Source>
-            <Actor>
-              <ActorID>user@gmail.com</ActorID>
-              <ActorRole>
-                <Text>Patient</Text>
-              </ActorRole>
-            </Actor>
-          </Source>
-        </Procedure>
-      </Procedures>
-    </Body>
-    <Actors>
-      <Actor>
-        <ActorObjectID>Google Health Profile</ActorObjectID>
-        <Person>
-          <Name>
-            <BirthName />
-            <CurrentName />
-          </Name>
-          <DateOfBirth>
-            <Type />
-            <ExactDateTime>1984-07-22</ExactDateTime>
-          </DateOfBirth>
-          <Gender>
-            <Text>Male</Text>
-          </Gender>
-        </Person>
-        <Status />
-        <Source>
-          <Actor>
-            <ActorID>user@gmail.com</ActorID>
-            <ActorRole>
-              <Text>Patient</Text>
-            </ActorRole>
-          </Actor>
-        </Source>
-      </Actor>
-    </Actors>
-  </ContinuityOfCareRecord>
-</entry>
-
-

+ 0 - 25
tests/Zend/Gdata/Health/_files/TestDataHealthProfileEntrySample_allergy0.xml

@@ -1,25 +0,0 @@
-<Alert xmlns="urn:astm-org:CCR">
-  <Type>
-    <Text>Allergy</Text>
-  </Type>
-  <Description>
-    <Text>A-Fil</Text>
-  </Description>
-  <Status>
-    <Text>ACTIVE</Text>
-  </Status>
-  <Source>
-    <Actor>
-      <ActorID>user@gmail.com</ActorID>
-      <ActorRole>
-        <Text>Patient</Text>
-      </ActorRole>
-    </Actor>
-  </Source>
-  <Reaction>
-    <Description />
-    <Severity>
-      <Text>Severe</Text>
-    </Severity>
-  </Reaction>
-</Alert>

+ 0 - 25
tests/Zend/Gdata/Health/_files/TestDataHealthProfileEntrySample_allergy1.xml

@@ -1,25 +0,0 @@
-<Alert xmlns="urn:astm-org:CCR">
-  <Type>
-    <Text>Allergy</Text>
-  </Type>
-  <Description>
-    <Text>A.E.R Traveler</Text>
-  </Description>
-  <Status>
-    <Text>ACTIVE</Text>
-  </Status>
-  <Source>
-    <Actor>
-      <ActorID>user@gmail.com</ActorID>
-      <ActorRole>
-        <Text>Patient</Text>
-      </ActorRole>
-    </Actor>
-  </Source>
-  <Reaction>
-    <Description />
-    <Severity>
-      <Text>Severe</Text>
-    </Severity>
-  </Reaction>
-</Alert>

+ 0 - 52
tests/Zend/Gdata/Health/_files/TestDataHealthProfileEntrySample_allergy_all.xml

@@ -1,52 +0,0 @@
-<Alerts>
-  <Alert>
-    <Type>
-      <Text>Allergy</Text>
-    </Type>
-    <Description>
-      <Text>A-Fil</Text>
-    </Description>
-    <Status>
-      <Text>ACTIVE</Text>
-    </Status>
-    <Source>
-      <Actor>
-        <ActorID>user@gmail.com</ActorID>
-        <ActorRole>
-          <Text>Patient</Text>
-        </ActorRole>
-      </Actor>
-    </Source>
-    <Reaction>
-      <Description />
-      <Severity>
-        <Text>Severe</Text>
-      </Severity>
-    </Reaction>
-  </Alert>
-  <Alert>
-    <Type>
-      <Text>Allergy</Text>
-    </Type>
-    <Description>
-      <Text>A.E.R Traveler</Text>
-    </Description>
-    <Status>
-      <Text>ACTIVE</Text>
-    </Status>
-    <Source>
-      <Actor>
-        <ActorID>user@gmail.com</ActorID>
-        <ActorRole>
-          <Text>Patient</Text>
-        </ActorRole>
-      </Actor>
-    </Source>
-    <Reaction>
-      <Description />
-      <Severity>
-        <Text>Severe</Text>
-      </Severity>
-    </Reaction>
-  </Alert>
-</Alerts>

+ 0 - 28
tests/Zend/Gdata/Health/_files/TestDataHealthProfileEntrySample_condition0.xml

@@ -1,28 +0,0 @@
-<Problem xmlns="urn:astm-org:CCR">
-  <CCRDataObjectID>Hn0FE0IlcY-FMFFgSTxkvA/CONDITION/0</CCRDataObjectID>
-  <DateTime>
-    <Type>
-      <Text>Start date</Text>
-    </Type>
-    <ExactDateTime>2007-04-04T07:00:00Z</ExactDateTime>
-  </DateTime>
-  <Description>
-    <Text>Aortic valve disorders</Text>
-    <Code>
-      <Value>410.10</Value>
-      <CodingSystem>ICD9</CodingSystem>
-      <Version>2004</Version>
-    </Code>
-  </Description>
-  <Status>
-    <Text>Active</Text>
-  </Status>
-  <Source>
-    <Actor>
-      <ActorID>example.com</ActorID>
-      <ActorRole>
-        <Text>Information Provider</Text>
-      </ActorRole>
-    </Actor>
-  </Source>
-</Problem>

+ 0 - 28
tests/Zend/Gdata/Health/_files/TestDataHealthProfileEntrySample_condition1.xml

@@ -1,28 +0,0 @@
-<Problem xmlns="urn:astm-org:CCR">
-  <Type />
-  <Description>
-    <Text>Malaria</Text>
-    <Code>
-      <Value>136.9</Value>
-      <CodingSystem>ICD9_Broader</CodingSystem>
-    </Code>
-    <Code>
-      <Value>084.6</Value>
-      <CodingSystem>ICD9</CodingSystem>
-    </Code>
-  </Description>
-  <Status>
-    <Text>ACTIVE</Text>
-  </Status>
-  <Source>
-    <Actor>
-      <ActorID>user@gmail.com</ActorID>
-      <ActorRole>
-        <Text>Patient</Text>
-      </ActorRole>
-    </Actor>
-  </Source>
-  <HealthStatus>
-    <Description />
-  </HealthStatus>
-</Problem>

+ 0 - 58
tests/Zend/Gdata/Health/_files/TestDataHealthProfileEntrySample_condition_all.xml

@@ -1,58 +0,0 @@
-<Problems>
-  <Problem>
-    <CCRDataObjectID>Hn0FE0IlcY-FMFFgSTxkvA/CONDITION/0</CCRDataObjectID>
-    <DateTime>
-      <Type>
-        <Text>Start date</Text>
-      </Type>
-      <ExactDateTime>2007-04-04T07:00:00Z</ExactDateTime>
-    </DateTime>
-    <Description>
-      <Text>Aortic valve disorders</Text>
-      <Code>
-        <Value>410.10</Value>
-        <CodingSystem>ICD9</CodingSystem>
-        <Version>2004</Version>
-      </Code>
-    </Description>
-    <Status>
-      <Text>Active</Text>
-    </Status>
-    <Source>
-      <Actor>
-        <ActorID>example.com</ActorID>
-        <ActorRole>
-          <Text>Information Provider</Text>
-        </ActorRole>
-      </Actor>
-    </Source>
-  </Problem>
-  <Problem>
-    <Type />
-    <Description>
-      <Text>Malaria</Text>
-      <Code>
-        <Value>136.9</Value>
-        <CodingSystem>ICD9_Broader</CodingSystem>
-      </Code>
-      <Code>
-        <Value>084.6</Value>
-        <CodingSystem>ICD9</CodingSystem>
-      </Code>
-    </Description>
-    <Status>
-      <Text>ACTIVE</Text>
-    </Status>
-    <Source>
-      <Actor>
-        <ActorID>user@gmail.com</ActorID>
-        <ActorRole>
-          <Text>Patient</Text>
-        </ActorRole>
-      </Actor>
-    </Source>
-    <HealthStatus>
-      <Description />
-    </HealthStatus>
-  </Problem>
-</Problems>

+ 0 - 548
tests/Zend/Gdata/Health/_files/TestDataHealthProfileEntrySample_just_ccr.xml

@@ -1,548 +0,0 @@
-<ContinuityOfCareRecord xmlns="urn:astm-org:CCR">
-  <CCRDocumentObjectID>vneCn5qdEIY</CCRDocumentObjectID>
-  <Language>
-    <Text>English</Text>
-    <Code>
-      <Value>en</Value>
-      <CodingSystem>ISO-639-1</CodingSystem>
-    </Code>
-  </Language>
-  <Version>V1.0</Version>
-  <DateTime>
-    <ExactDateTime>2008-09-29T07:52:17.176Z</ExactDateTime>
-  </DateTime>
-  <Patient>
-    <ActorID>Google Health Profile</ActorID>
-  </Patient>
-  <Body>
-    <FunctionalStatus>
-      <Function>
-        <Type>
-          <Text>Pregnancy status</Text>
-        </Type>
-        <Description>
-          <Text>Not pregnant</Text>
-        </Description>
-        <Status />
-        <Source>
-          <Actor>
-            <ActorID>user@google.com</ActorID>
-            <ActorRole>
-              <Text>Patient</Text>
-            </ActorRole>
-          </Actor>
-        </Source>
-      </Function>
-      <Function>
-        <Type>
-          <Text>Breastfeeding status</Text>
-        </Type>
-        <Description>
-          <Text>Not breastfeeding</Text>
-        </Description>
-        <Status />
-        <Source>
-          <Actor>
-            <ActorID>user@gmail.com</ActorID>
-            <ActorRole>
-              <Text>Patient</Text>
-            </ActorRole>
-          </Actor>
-        </Source>
-      </Function>
-    </FunctionalStatus>
-    <Problems>
-      <Problem>
-        <CCRDataObjectID>Hn0FE0IlcY-FMFFgSTxkvA/CONDITION/0</CCRDataObjectID>
-        <DateTime>
-          <Type>
-            <Text>Start date</Text>
-          </Type>
-          <ExactDateTime>2007-04-04T07:00:00Z</ExactDateTime>
-        </DateTime>
-        <Description>
-          <Text>Aortic valve disorders</Text>
-          <Code>
-            <Value>410.10</Value>
-            <CodingSystem>ICD9</CodingSystem>
-            <Version>2004</Version>
-          </Code>
-        </Description>
-        <Status>
-          <Text>Active</Text>
-        </Status>
-        <Source>
-          <Actor>
-            <ActorID>example.com</ActorID>
-            <ActorRole>
-              <Text>Information Provider</Text>
-            </ActorRole>
-          </Actor>
-        </Source>
-      </Problem>
-      <Problem>
-        <Type />
-        <Description>
-          <Text>Malaria</Text>
-          <Code>
-            <Value>136.9</Value>
-            <CodingSystem>ICD9_Broader</CodingSystem>
-          </Code>
-          <Code>
-            <Value>084.6</Value>
-            <CodingSystem>ICD9</CodingSystem>
-          </Code>
-        </Description>
-        <Status>
-          <Text>ACTIVE</Text>
-        </Status>
-        <Source>
-          <Actor>
-            <ActorID>user@gmail.com</ActorID>
-            <ActorRole>
-              <Text>Patient</Text>
-            </ActorRole>
-          </Actor>
-        </Source>
-        <HealthStatus>
-          <Description />
-        </HealthStatus>
-      </Problem>
-    </Problems>
-    <SocialHistory>
-      <SocialHistoryElement>
-        <Type>
-          <Text>Race</Text>
-          <Code>
-            <Value>S15814</Value>
-            <CodingSystem>HL7</CodingSystem>
-          </Code>
-        </Type>
-        <Description>
-          <Text>White</Text>
-        </Description>
-        <Status />
-        <Source>
-          <Actor>
-            <ActorID>user@gmail.com</ActorID>
-            <ActorRole>
-              <Text>Patient</Text>
-            </ActorRole>
-          </Actor>
-        </Source>
-        <Episodes>
-          <Frequency>
-            <Units />
-          </Frequency>
-        </Episodes>
-      </SocialHistoryElement>
-    </SocialHistory>
-    <Alerts>
-      <Alert>
-        <Type>
-          <Text>Allergy</Text>
-        </Type>
-        <Description>
-          <Text>A-Fil</Text>
-        </Description>
-        <Status>
-          <Text>ACTIVE</Text>
-        </Status>
-        <Source>
-          <Actor>
-            <ActorID>user@gmail.com</ActorID>
-            <ActorRole>
-              <Text>Patient</Text>
-            </ActorRole>
-          </Actor>
-        </Source>
-        <Reaction>
-          <Description />
-          <Severity>
-            <Text>Severe</Text>
-          </Severity>
-        </Reaction>
-      </Alert>
-      <Alert>
-        <Type>
-          <Text>Allergy</Text>
-        </Type>
-        <Description>
-          <Text>A.E.R Traveler</Text>
-        </Description>
-        <Status>
-          <Text>ACTIVE</Text>
-        </Status>
-        <Source>
-          <Actor>
-            <ActorID>user@gmail.com</ActorID>
-            <ActorRole>
-              <Text>Patient</Text>
-            </ActorRole>
-          </Actor>
-        </Source>
-        <Reaction>
-          <Description />
-          <Severity>
-            <Text>Severe</Text>
-          </Severity>
-        </Reaction>
-      </Alert>
-    </Alerts>
-    <Medications>
-      <Medication>
-        <Type />
-        <Description />
-        <Status>
-          <Text>ACTIVE</Text>
-        </Status>
-        <Source>
-          <Actor>
-            <ActorID>user@gmail.com</ActorID>
-            <ActorRole>
-              <Text>Patient</Text>
-            </ActorRole>
-          </Actor>
-        </Source>
-        <Product>
-          <ProductName>
-            <Text>A&amp; D</Text>
-          </ProductName>
-          <Strength>
-            <Units />
-            <StrengthSequencePosition>0</StrengthSequencePosition>
-            <VariableStrengthModifier />
-          </Strength>
-        </Product>
-        <Directions>
-          <Direction>
-            <Description />
-            <DeliveryMethod />
-            <Dose>
-              <Units />
-              <DoseSequencePosition>0</DoseSequencePosition>
-              <VariableDoseModifier />
-            </Dose>
-            <Route>
-              <Text>To skin</Text>
-              <Code>
-                <Value>C38305</Value>
-                <CodingSystem>FDA</CodingSystem>
-              </Code>
-              <RouteSequencePosition>0</RouteSequencePosition>
-              <MultipleRouteModifier />
-            </Route>
-          </Direction>
-        </Directions>
-        <Refills />
-      </Medication>
-      <Medication>
-        <Type />
-        <Description />
-        <Status>
-          <Text>ACTIVE</Text>
-        </Status>
-        <Source>
-          <Actor>
-            <ActorID>user@gmail.com</ActorID>
-            <ActorRole>
-              <Text>Patient</Text>
-            </ActorRole>
-          </Actor>
-        </Source>
-        <Product>
-          <ProductName>
-            <Text>A-Fil</Text>
-          </ProductName>
-          <Strength>
-            <Units />
-            <StrengthSequencePosition>0</StrengthSequencePosition>
-            <VariableStrengthModifier />
-          </Strength>
-        </Product>
-        <Directions>
-          <Direction>
-            <Description />
-            <DeliveryMethod />
-            <Dose>
-              <Units />
-              <DoseSequencePosition>0</DoseSequencePosition>
-              <VariableDoseModifier />
-            </Dose>
-            <Route>
-              <Text>To skin</Text>
-              <Code>
-                <Value>C38305</Value>
-                <CodingSystem>FDA</CodingSystem>
-              </Code>
-              <RouteSequencePosition>0</RouteSequencePosition>
-              <MultipleRouteModifier />
-            </Route>
-          </Direction>
-        </Directions>
-        <Refills />
-      </Medication>
-      <Medication>
-        <Type />
-        <Description />
-        <Status>
-          <Text>ACTIVE</Text>
-        </Status>
-        <Source>
-          <Actor>
-            <ActorID>user@gmail.com</ActorID>
-            <ActorRole>
-              <Text>Patient</Text>
-            </ActorRole>
-          </Actor>
-        </Source>
-        <Product>
-          <ProductName>
-            <Text>Lipitor</Text>
-          </ProductName>
-          <Strength>
-            <Units />
-            <StrengthSequencePosition>0</StrengthSequencePosition>
-            <VariableStrengthModifier />
-          </Strength>
-        </Product>
-        <Directions>
-          <Direction>
-            <Description />
-            <DeliveryMethod />
-            <Dose>
-              <Units />
-              <DoseSequencePosition>0</DoseSequencePosition>
-              <VariableDoseModifier />
-            </Dose>
-            <Route>
-              <Text>By mouth</Text>
-              <Code>
-                <Value>C38288</Value>
-                <CodingSystem>FDA</CodingSystem>
-              </Code>
-              <RouteSequencePosition>0</RouteSequencePosition>
-              <MultipleRouteModifier />
-            </Route>
-          </Direction>
-        </Directions>
-        <Refills />
-      </Medication>
-    </Medications>
-    <Immunizations>
-      <Immunization>
-        <Type />
-        <Description />
-        <Status />
-        <Source>
-          <Actor>
-            <ActorID>user@gmail.com</ActorID>
-            <ActorRole>
-              <Text>Patient</Text>
-            </ActorRole>
-          </Actor>
-        </Source>
-        <Product>
-          <ProductName>
-            <Text>Chickenpox Vaccine</Text>
-            <Code>
-              <Value>21</Value>
-              <CodingSystem>HL7</CodingSystem>
-            </Code>
-          </ProductName>
-        </Product>
-        <Directions>
-          <Direction>
-            <Description />
-            <DeliveryMethod />
-          </Direction>
-        </Directions>
-        <Refills />
-      </Immunization>
-    </Immunizations>
-    <VitalSigns>
-      <Result>
-        <Type />
-        <Description />
-        <Status />
-        <Source>
-          <Actor>
-            <ActorID>user@gmail.com</ActorID>
-            <ActorRole>
-              <Text>Patient</Text>
-            </ActorRole>
-          </Actor>
-        </Source>
-        <Substance />
-        <Test>
-          <Type />
-          <Description>
-            <Text>Height</Text>
-          </Description>
-          <Status />
-          <TestResult>
-            <ResultSequencePosition>0</ResultSequencePosition>
-            <VariableResultModifier />
-            <Value>70</Value>
-            <Units>
-              <Unit>inches</Unit>
-            </Units>
-          </TestResult>
-          <ConfidenceValue />
-        </Test>
-      </Result>
-      <Result>
-        <Type />
-        <Description />
-        <Status />
-        <Source>
-          <Actor>
-            <ActorID>user@gmail.com</ActorID>
-            <ActorRole>
-              <Text>Patient</Text>
-            </ActorRole>
-          </Actor>
-        </Source>
-        <Substance />
-        <Test>
-          <Type />
-          <Description>
-            <Text>Weight</Text>
-          </Description>
-          <Status />
-          <TestResult>
-            <ResultSequencePosition>0</ResultSequencePosition>
-            <VariableResultModifier />
-            <Value>2480</Value>
-            <Units>
-              <Unit>ounces</Unit>
-            </Units>
-          </TestResult>
-          <ConfidenceValue />
-        </Test>
-      </Result>
-      <Result>
-        <Type />
-        <Description />
-        <Status />
-        <Source>
-          <Actor>
-            <ActorID>user@gmail.com</ActorID>
-            <ActorRole>
-              <Text>Patient</Text>
-            </ActorRole>
-          </Actor>
-        </Source>
-        <Substance />
-        <Test>
-          <Type />
-          <Description>
-            <Text>Blood Type</Text>
-          </Description>
-          <Status />
-          <TestResult>
-            <ResultSequencePosition>0</ResultSequencePosition>
-            <VariableResultModifier />
-            <Value>O+</Value>
-            <Units />
-          </TestResult>
-          <ConfidenceValue />
-        </Test>
-      </Result>
-    </VitalSigns>
-    <Results>
-      <Result>
-        <Type />
-        <Description />
-        <Status />
-        <Source>
-          <Actor>
-            <ActorID>user@gmail.com</ActorID>
-            <ActorRole>
-              <Text>Patient</Text>
-            </ActorRole>
-          </Actor>
-        </Source>
-        <Substance />
-        <Test>
-          <DateTime>
-            <Type>
-              <Text>Collection start date</Text>
-            </Type>
-            <ExactDateTime>2008-09-03</ExactDateTime>
-          </DateTime>
-          <Type />
-          <Description>
-            <Text>Acetaldehyde - Blood</Text>
-          </Description>
-          <Status />
-          <TestResult>
-            <ResultSequencePosition>0</ResultSequencePosition>
-            <VariableResultModifier />
-            <Units />
-          </TestResult>
-          <ConfidenceValue />
-        </Test>
-      </Result>
-    </Results>
-    <Procedures>
-      <Procedure>
-        <Type />
-        <Description>
-          <Text>Abdominal Ultrasound</Text>
-        </Description>
-        <Status />
-        <Source>
-          <Actor>
-            <ActorID>user@gmail.com</ActorID>
-            <ActorRole>
-              <Text>Patient</Text>
-            </ActorRole>
-          </Actor>
-        </Source>
-      </Procedure>
-      <Procedure>
-        <Type />
-        <Description>
-          <Text>Abdominoplasty</Text>
-        </Description>
-        <Status />
-        <Source>
-          <Actor>
-            <ActorID>user@gmail.com</ActorID>
-            <ActorRole>
-              <Text>Patient</Text>
-            </ActorRole>
-          </Actor>
-        </Source>
-      </Procedure>
-    </Procedures>
-  </Body>
-  <Actors>
-    <Actor>
-      <ActorObjectID>Google Health Profile</ActorObjectID>
-      <Person>
-        <Name>
-          <BirthName />
-          <CurrentName />
-        </Name>
-        <DateOfBirth>
-          <Type />
-          <ExactDateTime>1984-07-22</ExactDateTime>
-        </DateOfBirth>
-        <Gender>
-          <Text>Male</Text>
-        </Gender>
-      </Person>
-      <Status />
-      <Source>
-        <Actor>
-          <ActorID>user@gmail.com</ActorID>
-          <ActorRole>
-            <Text>Patient</Text>
-          </ActorRole>
-        </Actor>
-      </Source>
-    </Actor>
-  </Actors>
-</ContinuityOfCareRecord>

+ 0 - 48
tests/Zend/Gdata/Health/_files/TestDataHealthProfileEntrySample_medications0.xml

@@ -1,48 +0,0 @@
-<Medications>
-<Medication>
-  <Type />
-  <Description />
-  <Status>
-    <Text>ACTIVE</Text>
-  </Status>
-  <Source>
-    <Actor>
-      <ActorID>user@gmail.com</ActorID>
-      <ActorRole>
-        <Text>Patient</Text>
-      </ActorRole>
-    </Actor>
-  </Source>
-  <Product>
-    <ProductName>
-      <Text>A&amp; D</Text>
-    </ProductName>
-    <Strength>
-      <Units />
-      <StrengthSequencePosition>0</StrengthSequencePosition>
-      <VariableStrengthModifier />
-    </Strength>
-  </Product>
-  <Directions>
-    <Direction>
-      <Description />
-      <DeliveryMethod />
-      <Dose>
-        <Units />
-        <DoseSequencePosition>0</DoseSequencePosition>
-        <VariableDoseModifier />
-      </Dose>
-      <Route>
-        <Text>To skin</Text>
-        <Code>
-          <Value>C38305</Value>
-          <CodingSystem>FDA</CodingSystem>
-        </Code>
-        <RouteSequencePosition>0</RouteSequencePosition>
-        <MultipleRouteModifier />
-      </Route>
-    </Direction>
-  </Directions>
-  <Refills />
-</Medication>
-</Medications>

+ 0 - 48
tests/Zend/Gdata/Health/_files/TestDataHealthProfileEntrySample_medications1.xml

@@ -1,48 +0,0 @@
-<Medications>
-<Medication>
-  <Type />
-  <Description />
-  <Status>
-    <Text>ACTIVE</Text>
-  </Status>
-  <Source>
-    <Actor>
-      <ActorID>user@gmail.com</ActorID>
-      <ActorRole>
-        <Text>Patient</Text>
-      </ActorRole>
-    </Actor>
-  </Source>
-  <Product>
-    <ProductName>
-      <Text>A-Fil</Text>
-    </ProductName>
-    <Strength>
-      <Units />
-      <StrengthSequencePosition>0</StrengthSequencePosition>
-      <VariableStrengthModifier />
-    </Strength>
-  </Product>
-  <Directions>
-    <Direction>
-      <Description />
-      <DeliveryMethod />
-      <Dose>
-        <Units />
-        <DoseSequencePosition>0</DoseSequencePosition>
-        <VariableDoseModifier />
-      </Dose>
-      <Route>
-        <Text>To skin</Text>
-        <Code>
-          <Value>C38305</Value>
-          <CodingSystem>FDA</CodingSystem>
-        </Code>
-        <RouteSequencePosition>0</RouteSequencePosition>
-        <MultipleRouteModifier />
-      </Route>
-    </Direction>
-  </Directions>
-  <Refills />
-</Medication>
-</Medications>

+ 0 - 48
tests/Zend/Gdata/Health/_files/TestDataHealthProfileEntrySample_medications2.xml

@@ -1,48 +0,0 @@
-<Medications>
-<Medication>
-  <Type />
-  <Description />
-  <Status>
-    <Text>ACTIVE</Text>
-  </Status>
-  <Source>
-    <Actor>
-      <ActorID>user@gmail.com</ActorID>
-      <ActorRole>
-        <Text>Patient</Text>
-      </ActorRole>
-    </Actor>
-  </Source>
-  <Product>
-    <ProductName>
-      <Text>Lipitor</Text>
-    </ProductName>
-    <Strength>
-      <Units />
-      <StrengthSequencePosition>0</StrengthSequencePosition>
-      <VariableStrengthModifier />
-    </Strength>
-  </Product>
-  <Directions>
-    <Direction>
-      <Description />
-      <DeliveryMethod />
-      <Dose>
-        <Units />
-        <DoseSequencePosition>0</DoseSequencePosition>
-        <VariableDoseModifier />
-      </Dose>
-      <Route>
-        <Text>By mouth</Text>
-        <Code>
-          <Value>C38288</Value>
-          <CodingSystem>FDA</CodingSystem>
-        </Code>
-        <RouteSequencePosition>0</RouteSequencePosition>
-        <MultipleRouteModifier />
-      </Route>
-    </Direction>
-  </Directions>
-  <Refills />
-</Medication>
-</Medications>

+ 0 - 48
tests/Zend/Gdata/Health/_files/TestDataHealthProfileEntrySample_medications3.xml

@@ -1,48 +0,0 @@
-<Medications>
-<Medication>
-  <Type />
-  <Description />
-  <Status>
-    <Text>ACTIVE</Text>
-  </Status>
-  <Source>
-    <Actor>
-      <ActorID>user@gmail.com</ActorID>
-      <ActorRole>
-        <Text>Patient</Text>
-      </ActorRole>
-    </Actor>
-  </Source>
-  <Product>
-    <ProductName>
-      <Text>A&amp; D</Text>
-    </ProductName>
-    <Strength>
-      <Units />
-      <StrengthSequencePosition>0</StrengthSequencePosition>
-      <VariableStrengthModifier />
-    </Strength>
-  </Product>
-  <Directions>
-    <Direction>
-      <Description />
-      <DeliveryMethod />
-      <Dose>
-        <Units />
-        <DoseSequencePosition>0</DoseSequencePosition>
-        <VariableDoseModifier />
-      </Dose>
-      <Route>
-        <Text>To skin</Text>
-        <Code>
-          <Value>C38305</Value>
-          <CodingSystem>FDA</CodingSystem>
-        </Code>
-        <RouteSequencePosition>0</RouteSequencePosition>
-        <MultipleRouteModifier />
-      </Route>
-    </Direction>
-  </Directions>
-  <Refills />
-</Medication>
-</Medications>

+ 0 - 140
tests/Zend/Gdata/Health/_files/TestDataHealthProfileEntrySample_medications_all.xml

@@ -1,140 +0,0 @@
-<Medications>
-  <Medication>
-    <Type />
-    <Description />
-    <Status>
-      <Text>ACTIVE</Text>
-    </Status>
-    <Source>
-      <Actor>
-        <ActorID>user@gmail.com</ActorID>
-        <ActorRole>
-          <Text>Patient</Text>
-        </ActorRole>
-      </Actor>
-    </Source>
-    <Product>
-      <ProductName>
-        <Text>A&amp; D</Text>
-      </ProductName>
-      <Strength>
-        <Units />
-        <StrengthSequencePosition>0</StrengthSequencePosition>
-        <VariableStrengthModifier />
-      </Strength>
-    </Product>
-    <Directions>
-      <Direction>
-        <Description />
-        <DeliveryMethod />
-        <Dose>
-          <Units />
-          <DoseSequencePosition>0</DoseSequencePosition>
-          <VariableDoseModifier />
-        </Dose>
-        <Route>
-          <Text>To skin</Text>
-          <Code>
-            <Value>C38305</Value>
-            <CodingSystem>FDA</CodingSystem>
-          </Code>
-          <RouteSequencePosition>0</RouteSequencePosition>
-          <MultipleRouteModifier />
-        </Route>
-      </Direction>
-    </Directions>
-    <Refills />
-  </Medication>
-  <Medication>
-    <Type />
-    <Description />
-    <Status>
-      <Text>ACTIVE</Text>
-    </Status>
-    <Source>
-      <Actor>
-        <ActorID>user@gmail.com</ActorID>
-        <ActorRole>
-          <Text>Patient</Text>
-        </ActorRole>
-      </Actor>
-    </Source>
-    <Product>
-      <ProductName>
-        <Text>A-Fil</Text>
-      </ProductName>
-      <Strength>
-        <Units />
-        <StrengthSequencePosition>0</StrengthSequencePosition>
-        <VariableStrengthModifier />
-      </Strength>
-    </Product>
-    <Directions>
-      <Direction>
-        <Description />
-        <DeliveryMethod />
-        <Dose>
-          <Units />
-          <DoseSequencePosition>0</DoseSequencePosition>
-          <VariableDoseModifier />
-        </Dose>
-        <Route>
-          <Text>To skin</Text>
-          <Code>
-            <Value>C38305</Value>
-            <CodingSystem>FDA</CodingSystem>
-          </Code>
-          <RouteSequencePosition>0</RouteSequencePosition>
-          <MultipleRouteModifier />
-        </Route>
-      </Direction>
-    </Directions>
-    <Refills />
-  </Medication>
-  <Medication>
-    <Type />
-    <Description />
-    <Status>
-      <Text>ACTIVE</Text>
-    </Status>
-    <Source>
-      <Actor>
-        <ActorID>user@gmail.com</ActorID>
-        <ActorRole>
-          <Text>Patient</Text>
-        </ActorRole>
-      </Actor>
-    </Source>
-    <Product>
-      <ProductName>
-        <Text>Lipitor</Text>
-      </ProductName>
-      <Strength>
-        <Units />
-        <StrengthSequencePosition>0</StrengthSequencePosition>
-        <VariableStrengthModifier />
-      </Strength>
-    </Product>
-    <Directions>
-      <Direction>
-        <Description />
-        <DeliveryMethod />
-        <Dose>
-          <Units />
-          <DoseSequencePosition>0</DoseSequencePosition>
-          <VariableDoseModifier />
-        </Dose>
-        <Route>
-          <Text>By mouth</Text>
-          <Code>
-            <Value>C38288</Value>
-            <CodingSystem>FDA</CodingSystem>
-          </Code>
-          <RouteSequencePosition>0</RouteSequencePosition>
-          <MultipleRouteModifier />
-        </Route>
-      </Direction>
-    </Directions>
-    <Refills />
-  </Medication>
-</Medications>

+ 0 - 35
tests/Zend/Gdata/Health/_files/TestDataHealthProfileEntrySample_results0.xml

@@ -1,35 +0,0 @@
-<Results>
-<Result>
-  <Type />
-  <Description />
-  <Status />
-  <Source>
-    <Actor>
-      <ActorID>user@gmail.com</ActorID>
-      <ActorRole>
-        <Text>Patient</Text>
-      </ActorRole>
-    </Actor>
-  </Source>
-  <Substance />
-  <Test>
-    <DateTime>
-      <Type>
-        <Text>Collection start date</Text>
-      </Type>
-      <ExactDateTime>2008-09-03</ExactDateTime>
-    </DateTime>
-    <Type />
-    <Description>
-      <Text>Acetaldehyde - Blood</Text>
-    </Description>
-    <Status />
-    <TestResult>
-      <ResultSequencePosition>0</ResultSequencePosition>
-      <VariableResultModifier />
-      <Units />
-    </TestResult>
-    <ConfidenceValue />
-  </Test>
-</Result>
-</Results>

+ 0 - 948
tests/Zend/Gdata/Health/_files/TestDataHealthProfileFeedSample.xml

@@ -1,948 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<feed xmlns="http://www.w3.org/2005/Atom" xmlns:openSearch="http://a9.com/-/spec/opensearchrss/1.0/" xmlns:ccr="urn:astm-org:CCR" xmlns:batch="http://schemas.google.com/gdata/batch" xmlns:h9m="http://schemas.google.com/health/metadata">
-<id>https://www.google.com/health/feeds/profile/default</id>
-<updated>2008-09-30T01:07:17.888Z</updated>
-<category scheme="http://schemas.google.com/g/2005#kind" term="http://schemas.google.com/health/kinds#profile"/>
-<title type="text">Profile Feed</title>
-<link rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml" href="https://www.google.com/health/feeds/profile/default"/>
-<link rel="http://schemas.google.com/g/2005#post" type="application/atom+xml" href="https://www.google.com/health/feeds/profile/default"/>
-<link rel="http://schemas.google.com/g/2005#batch" type="application/atom+xml" href="https://www.google.com/health/feeds/profile/default/batch"/>
-<link rel="self" type="application/atom+xml" href="https://www.google.com/health/feeds/profile/default?digest=false"/>
-<openSearch:startIndex>1</openSearch:startIndex>
-<entry>
-    <id>https://www.google.com/health/feeds/profile/default/DysasdfARnFAao</id>
-    <published>2008-09-29T03:12:50.850Z</published>
-    <updated>2008-09-29T03:12:50.850Z</updated>
-    <category term="MEDICATION"/>
-    <category scheme="http://schemas.google.com/g/2005#kind" term="http://schemas.google.com/health/kinds#profile"/>
-    <category scheme="http://schemas.google.com/health/item" term="A&amp; D"/>
-    <title type="text"/>
-    <content type="html"/>
-    <link rel="http://schemas.google.com/health/data#complete" type="application/atom+xml" href="https://www.google.com/health/feeds/profile/default/-/MEDICATION/%7Bhttp%3A%2F%2Fschemas.google.com%2Fg%2F2005%23kind%7Dhttp%3A%2F%2Fschemas.google.com%2Fhealth%2Fkinds%23profile/%7Bhttp%3A%2F%2Fschemas.google.com%2Fhealth%2Fitem%7DA%26+D"/>
-    <link rel="self" type="application/atom+xml" href="https://www.google.com/health/feeds/profile/default/DysasdfARnFAao"/>
-    <link rel="edit" type="application/atom+xml" href="https://www.google.com/health/feeds/profile/default/DysasdfARnFAao"/>
-    <author>
-        <name>User Name</name>
-        <email>user@gmail.com</email>
-    </author>
-    <ContinuityOfCareRecord xmlns="urn:astm-org:CCR">
-        <CCRDocumentObjectID>hiD9sEigSzdk8nNT0evR4g</CCRDocumentObjectID>
-        <Language/>
-        <DateTime>
-            <Type/>
-        </DateTime>
-        <Patient/>
-        <Body>
-            <Medications>
-                <Medication>
-                    <Type/>
-                    <Description/>
-                    <Status>
-                        <Text>ACTIVE</Text>
-                    </Status>
-                    <Source>
-                        <Actor>
-                            <ActorID>user@gmail.com</ActorID>
-                            <ActorRole>
-                                <Text>Patient</Text>
-                            </ActorRole>
-                        </Actor>
-                    </Source>
-                    <Product>
-                        <ProductName>
-                            <Text>A&amp; D</Text>
-                        </ProductName>
-                        <Strength>
-                            <Units/>
-                            <StrengthSequencePosition>0</StrengthSequencePosition>
-                            <VariableStrengthModifier/>
-                        </Strength>
-                    </Product>
-                    <Directions>
-                        <Direction>
-                            <Description/>
-                            <DeliveryMethod/>
-                            <Dose>
-                                <Units/>
-                                <DoseSequencePosition>0</DoseSequencePosition>
-                                <VariableDoseModifier/>
-                            </Dose>
-                            <Route>
-                                <Text>To skin</Text>
-                                <Code>
-                                    <Value>C38305</Value>
-                                    <CodingSystem>FDA</CodingSystem>
-                                </Code>
-                                <RouteSequencePosition>0</RouteSequencePosition>
-                                <MultipleRouteModifier/>
-                            </Route>
-                        </Direction>
-                    </Directions>
-                    <Refills/>
-                </Medication>
-            </Medications>
-        </Body>
-    </ContinuityOfCareRecord>
-</entry>
-<entry>
-    <id>https://www.google.com/health/feeds/profile/default/7I1WQzZrgp4</id>
-    <published>2008-09-29T03:27:14.909Z</published>
-    <updated>2008-09-29T03:27:14.909Z</updated>
-    <category scheme="http://schemas.google.com/g/2005#kind" term="http://schemas.google.com/health/kinds#profile"/>
-    <category scheme="http://schemas.google.com/health/item" term="A-Fil"/>
-    <category term="ALLERGY"/>
-    <title type="text"/>
-    <content type="html"/>
-    <link rel="http://schemas.google.com/health/data#complete" type="application/atom+xml" href="https://www.google.com/health/feeds/profile/default/-/%7Bhttp%3A%2F%2Fschemas.google.com%2Fg%2F2005%23kind%7Dhttp%3A%2F%2Fschemas.google.com%2Fhealth%2Fkinds%23profile/%7Bhttp%3A%2F%2Fschemas.google.com%2Fhealth%2Fitem%7DA-Fil/ALLERGY"/>
-    <link rel="self" type="application/atom+xml" href="https://www.google.com/health/feeds/profile/default/7I1WQzZrgp4"/>
-    <link rel="edit" type="application/atom+xml" href="https://www.google.com/health/feeds/profile/default/7I1WQzZrgp4"/>
-    <author>
-        <name>User Name</name>
-        <email>user@gmail.com</email>
-    </author>
-    <ContinuityOfCareRecord xmlns="urn:astm-org:CCR">
-        <CCRDocumentObjectID>YOyHDxQUiECCPgnsjV8SlQ</CCRDocumentObjectID>
-        <Language/>
-        <DateTime>
-            <Type/>
-        </DateTime>
-        <Patient/>
-        <Body>
-            <Alerts>
-                <Alert>
-                    <Type>
-                        <Text>Allergy</Text>
-                    </Type>
-                    <Description>
-                        <Text>A-Fil</Text>
-                    </Description>
-                    <Status>
-                        <Text>ACTIVE</Text>
-                    </Status>
-                    <Source>
-                        <Actor>
-                            <ActorID>user@gmail.com</ActorID>
-                            <ActorRole>
-                                <Text>Patient</Text>
-                            </ActorRole>
-                        </Actor>
-                    </Source>
-                    <Reaction>
-                        <Description/>
-                        <Severity>
-                            <Text>Severe</Text>
-                        </Severity>
-                    </Reaction>
-                </Alert>
-            </Alerts>
-        </Body>
-    </ContinuityOfCareRecord>
-</entry>
-<entry>
-    <id>https://www.google.com/health/feeds/profile/default/Dz9wV83sKFg</id>
-    <published>2008-09-29T03:12:52.166Z</published>
-    <updated>2008-09-29T03:12:52.167Z</updated>
-    <category term="MEDICATION"/>
-    <category scheme="http://schemas.google.com/g/2005#kind" term="http://schemas.google.com/health/kinds#profile"/>
-    <category scheme="http://schemas.google.com/health/item" term="A-Fil"/>
-    <title type="text"/>
-    <content type="html"/>
-    <link rel="http://schemas.google.com/health/data#complete" type="application/atom+xml" href="https://www.google.com/health/feeds/profile/default/-/MEDICATION/%7Bhttp%3A%2F%2Fschemas.google.com%2Fg%2F2005%23kind%7Dhttp%3A%2F%2Fschemas.google.com%2Fhealth%2Fkinds%23profile/%7Bhttp%3A%2F%2Fschemas.google.com%2Fhealth%2Fitem%7DA-Fil"/>
-    <link rel="self" type="application/atom+xml" href="https://www.google.com/health/feeds/profile/default/Dz9wV83sKFg"/>
-    <link rel="edit" type="application/atom+xml" href="https://www.google.com/health/feeds/profile/default/Dz9wV83sKFg"/>
-    <author>
-        <name>User Name</name>
-        <email>user@gmail.com</email>
-    </author>
-    <ContinuityOfCareRecord xmlns="urn:astm-org:CCR">
-        <CCRDocumentObjectID>7w.XFEPeuIYN3Rn32pUiUw</CCRDocumentObjectID>
-        <Language/>
-        <DateTime>
-            <Type/>
-        </DateTime>
-        <Patient/>
-        <Body>
-            <Medications>
-                <Medication>
-                    <Type/>
-                    <Description/>
-                    <Status>
-                        <Text>ACTIVE</Text>
-                    </Status>
-                    <Source>
-                        <Actor>
-                            <ActorID>user@gmail.com</ActorID>
-                            <ActorRole>
-                                <Text>Patient</Text>
-                            </ActorRole>
-                        </Actor>
-                    </Source>
-                    <Product>
-                        <ProductName>
-                            <Text>A-Fil</Text>
-                        </ProductName>
-                        <Strength>
-                            <Units/>
-                            <StrengthSequencePosition>0</StrengthSequencePosition>
-                            <VariableStrengthModifier/>
-                        </Strength>
-                    </Product>
-                    <Directions>
-                        <Direction>
-                            <Description/>
-                            <DeliveryMethod/>
-                            <Dose>
-                                <Units/>
-                                <DoseSequencePosition>0</DoseSequencePosition>
-                                <VariableDoseModifier/>
-                            </Dose>
-                            <Route>
-                                <Text>To skin</Text>
-                                <Code>
-                                    <Value>C38305</Value>
-                                    <CodingSystem>FDA</CodingSystem>
-                                </Code>
-                                <RouteSequencePosition>0</RouteSequencePosition>
-                                <MultipleRouteModifier/>
-                            </Route>
-                        </Direction>
-                    </Directions>
-                    <Refills/>
-                </Medication>
-            </Medications>
-        </Body>
-    </ContinuityOfCareRecord>
-</entry>
-<entry>
-    <id>https://www.google.com/health/feeds/profile/default/lzsxVzqZUyw</id>
-    <published>2008-09-29T03:13:07.496Z</published>
-    <updated>2008-09-29T03:13:07.497Z</updated>
-    <category scheme="http://schemas.google.com/health/item" term="A.E.R Traveler"/>
-    <category scheme="http://schemas.google.com/g/2005#kind" term="http://schemas.google.com/health/kinds#profile"/>
-    <category term="ALLERGY"/>
-    <title type="text"/>
-    <content type="html"/>
-    <link rel="http://schemas.google.com/health/data#complete" type="application/atom+xml" href="https://www.google.com/health/feeds/profile/default/-/%7Bhttp%3A%2F%2Fschemas.google.com%2Fhealth%2Fitem%7DA.E.R+Traveler/%7Bhttp%3A%2F%2Fschemas.google.com%2Fg%2F2005%23kind%7Dhttp%3A%2F%2Fschemas.google.com%2Fhealth%2Fkinds%23profile/ALLERGY"/>
-    <link rel="self" type="application/atom+xml" href="https://www.google.com/health/feeds/profile/default/lzsxVzqZUyw"/>
-    <link rel="edit" type="application/atom+xml" href="https://www.google.com/health/feeds/profile/default/lzsxVzqZUyw"/>
-    <author>
-        <name>User Name</name>
-        <email>user@gmail.com</email>
-    </author>
-    <ContinuityOfCareRecord xmlns="urn:astm-org:CCR">
-        <CCRDocumentObjectID>5efFB0J2WgEHNUvk2z3A1A</CCRDocumentObjectID>
-        <Language/>
-        <DateTime>
-            <Type/>
-        </DateTime>
-        <Patient/>
-        <Body>
-            <Alerts>
-                <Alert>
-                    <Type>
-                        <Text>Allergy</Text>
-                    </Type>
-                    <Description>
-                        <Text>A.E.R Traveler</Text>
-                    </Description>
-                    <Status>
-                        <Text>ACTIVE</Text>
-                    </Status>
-                    <Source>
-                        <Actor>
-                            <ActorID>user@gmail.com</ActorID>
-                            <ActorRole>
-                                <Text>Patient</Text>
-                            </ActorRole>
-                        </Actor>
-                    </Source>
-                    <Reaction>
-                        <Description/>
-                        <Severity>
-                            <Text>Severe</Text>
-                        </Severity>
-                    </Reaction>
-                </Alert>
-            </Alerts>
-        </Body>
-    </ContinuityOfCareRecord>
-</entry>
-<entry>
-    <id>https://www.google.com/health/feeds/profile/default/6PvhfKAXyYw</id>
-    <published>2008-09-29T03:13:02.123Z</published>
-    <updated>2008-09-29T03:13:02.124Z</updated>
-    <category scheme="http://schemas.google.com/g/2005#kind" term="http://schemas.google.com/health/kinds#profile"/>
-    <category term="PROCEDURE"/>
-    <category scheme="http://schemas.google.com/health/item" term="Abdominal Ultrasound"/>
-    <title type="text"/>
-    <content type="html"/>
-    <link rel="http://schemas.google.com/health/data#complete" type="application/atom+xml" href="https://www.google.com/health/feeds/profile/default/-/%7Bhttp%3A%2F%2Fschemas.google.com%2Fg%2F2005%23kind%7Dhttp%3A%2F%2Fschemas.google.com%2Fhealth%2Fkinds%23profile/PROCEDURE/%7Bhttp%3A%2F%2Fschemas.google.com%2Fhealth%2Fitem%7DAbdominal+Ultrasound"/>
-    <link rel="self" type="application/atom+xml" href="https://www.google.com/health/feeds/profile/default/6PvhfKAXyYw"/>
-    <link rel="edit" type="application/atom+xml" href="https://www.google.com/health/feeds/profile/default/6PvhfKAXyYw"/>
-    <author>
-        <name>User Name</name>
-        <email>user@gmail.com</email>
-    </author>
-    <ContinuityOfCareRecord xmlns="urn:astm-org:CCR">
-        <CCRDocumentObjectID>W3Wbvx_QHwG5pxVchpuF1A</CCRDocumentObjectID>
-        <Language/>
-        <DateTime>
-            <Type/>
-        </DateTime>
-        <Patient/>
-        <Body>
-            <Procedures>
-                <Procedure>
-                    <Type/>
-                    <Description>
-                        <Text>Abdominal Ultrasound</Text>
-                    </Description>
-                    <Status/>
-                    <Source>
-                        <Actor>
-                            <ActorID>user@gmail.com</ActorID>
-                            <ActorRole>
-                                <Text>Patient</Text>
-                            </ActorRole>
-                        </Actor>
-                    </Source>
-                </Procedure>
-            </Procedures>
-        </Body>
-    </ContinuityOfCareRecord>
-</entry>
-<entry>
-    <id>https://www.google.com/health/feeds/profile/default/r2zGPGewCeU</id>
-    <published>2008-09-29T03:13:03.434Z</published>
-    <updated>2008-09-29T03:13:03.435Z</updated>
-    <category scheme="http://schemas.google.com/health/item" term="Abdominoplasty"/>
-    <category scheme="http://schemas.google.com/g/2005#kind" term="http://schemas.google.com/health/kinds#profile"/>
-    <category term="PROCEDURE"/>
-    <title type="text"/>
-    <content type="html"/>
-    <link rel="http://schemas.google.com/health/data#complete" type="application/atom+xml" href="https://www.google.com/health/feeds/profile/default/-/%7Bhttp%3A%2F%2Fschemas.google.com%2Fhealth%2Fitem%7DAbdominoplasty/%7Bhttp%3A%2F%2Fschemas.google.com%2Fg%2F2005%23kind%7Dhttp%3A%2F%2Fschemas.google.com%2Fhealth%2Fkinds%23profile/PROCEDURE"/>
-    <link rel="self" type="application/atom+xml" href="https://www.google.com/health/feeds/profile/default/r2zGPGewCeU"/>
-    <link rel="edit" type="application/atom+xml" href="https://www.google.com/health/feeds/profile/default/r2zGPGewCeU"/>
-    <author>
-        <name>User Name</name>
-        <email>user@gmail.com</email>
-    </author>
-    <ContinuityOfCareRecord xmlns="urn:astm-org:CCR">
-        <CCRDocumentObjectID>OUKgj5X0KMnbkC5sDL.yHA</CCRDocumentObjectID>
-        <Language/>
-        <DateTime>
-            <Type/>
-        </DateTime>
-        <Patient/>
-        <Body>
-            <Procedures>
-                <Procedure>
-                    <Type/>
-                    <Description>
-                        <Text>Abdominoplasty</Text>
-                    </Description>
-                    <Status/>
-                    <Source>
-                        <Actor>
-                            <ActorID>user@gmail.com</ActorID>
-                            <ActorRole>
-                                <Text>Patient</Text>
-                            </ActorRole>
-                        </Actor>
-                    </Source>
-                </Procedure>
-            </Procedures>
-        </Body>
-    </ContinuityOfCareRecord>
-</entry>
-<entry>
-    <id>https://www.google.com/health/feeds/profile/default/_cCCbQ0O3ug</id>
-    <published>2008-09-29T03:13:29.041Z</published>
-    <updated>2008-09-29T03:13:29.042Z</updated>
-    <category scheme="http://schemas.google.com/g/2005#kind" term="http://schemas.google.com/health/kinds#profile"/>
-    <category scheme="http://schemas.google.com/health/item" term="Acetaldehyde - Blood"/>
-    <category term="LABTEST"/>
-    <title type="text"/>
-    <content type="html"/>
-    <link rel="http://schemas.google.com/health/data#complete" type="application/atom+xml" href="https://www.google.com/health/feeds/profile/default/-/%7Bhttp%3A%2F%2Fschemas.google.com%2Fg%2F2005%23kind%7Dhttp%3A%2F%2Fschemas.google.com%2Fhealth%2Fkinds%23profile/%7Bhttp%3A%2F%2Fschemas.google.com%2Fhealth%2Fitem%7DAcetaldehyde+-+Blood/LABTEST"/>
-    <link rel="self" type="application/atom+xml" href="https://www.google.com/health/feeds/profile/default/_cCCbQ0O3ug"/>
-    <link rel="edit" type="application/atom+xml" href="https://www.google.com/health/feeds/profile/default/_cCCbQ0O3ug"/>
-    <author>
-        <name>User Name</name>
-        <email>user@gmail.com</email>
-    </author>
-    <ContinuityOfCareRecord xmlns="urn:astm-org:CCR">
-        <CCRDocumentObjectID>YWtomFb8aG.DueZ7z7fyug</CCRDocumentObjectID>
-        <Language/>
-        <DateTime>
-            <Type/>
-        </DateTime>
-        <Patient/>
-        <Body>
-            <Results>
-                <Result>
-                    <Type/>
-                    <Description/>
-                    <Status/>
-                    <Source>
-                        <Actor>
-                            <ActorID>user@gmail.com</ActorID>
-                            <ActorRole>
-                                <Text>Patient</Text>
-                            </ActorRole>
-                        </Actor>
-                    </Source>
-                    <Substance/>
-                    <Test>
-                        <DateTime>
-                            <Type>
-                                <Text>Collection start date</Text>
-                            </Type>
-                            <ExactDateTime>2008-09-03</ExactDateTime>
-                        </DateTime>
-                        <Type/>
-                        <Description>
-                            <Text>Acetaldehyde - Blood</Text>
-                        </Description>
-                        <Status/>
-                        <TestResult>
-                            <ResultSequencePosition>0</ResultSequencePosition>
-                            <VariableResultModifier/>
-                            <Units/>
-                        </TestResult>
-                        <ConfidenceValue/>
-                    </Test>
-                </Result>
-            </Results>
-        </Body>
-    </ContinuityOfCareRecord>
-</entry>
-<entry>
-    <id>https://www.google.com/health/feeds/profile/default/BdyA3iJZyCc</id>
-    <published>2008-09-29T03:00:45.915Z</published>
-    <updated>2008-09-29T03:00:45.915Z</updated>
-    <category scheme="http://schemas.google.com/health/item" term="Aortic valve disorders"/>
-    <category scheme="http://schemas.google.com/g/2005#kind" term="http://schemas.google.com/health/kinds#profile"/>
-    <category term="CONDITION"/>
-    <title type="text">Aortic valve disorders</title>
-    <link rel="http://schemas.google.com/health/data#complete" type="application/atom+xml" href="https://www.google.com/health/feeds/profile/default/-/%7Bhttp%3A%2F%2Fschemas.google.com%2Fhealth%2Fitem%7DAortic+valve+disorders/%7Bhttp%3A%2F%2Fschemas.google.com%2Fg%2F2005%23kind%7Dhttp%3A%2F%2Fschemas.google.com%2Fhealth%2Fkinds%23profile/CONDITION"/>
-    <link rel="self" type="application/atom+xml" href="https://www.google.com/health/feeds/profile/default/BdyA3iJZyCc"/>
-    <link rel="edit" type="application/atom+xml" href="https://www.google.com/health/feeds/profile/default/BdyA3iJZyCc"/>
-    <author>
-        <name>example.com</name>
-        <uri>example.com</uri>
-    </author>
-    <ContinuityOfCareRecord xmlns="urn:astm-org:CCR">
-        <CCRDocumentObjectID>h1ljpoeKJ85li.1FHsG9Gw</CCRDocumentObjectID>
-        <Body>
-            <Problems>
-                <Problem>
-                    <CCRDataObjectID>Hn0FE0IlcY-FMFFgSTxkvA/CONDITION/0</CCRDataObjectID>
-                    <DateTime>
-                        <Type>
-                            <Text>Start date</Text>
-                        </Type>
-                        <ExactDateTime>2007-04-04T07:00:00Z</ExactDateTime>
-                    </DateTime>
-                    <Description>
-                        <Text>Aortic valve disorders</Text>
-                        <Code>
-                            <Value>410.10</Value>
-                            <CodingSystem>ICD9</CodingSystem>
-                            <Version>2004</Version>
-                        </Code>
-                    </Description>
-                    <Status>
-                        <Text>Active</Text>
-                    </Status>
-                    <Source>
-                        <Actor>
-                            <ActorID>example.com</ActorID>
-                            <ActorRole>
-                                <Text>Information Provider</Text>
-                            </ActorRole>
-                        </Actor>
-                    </Source>
-                </Problem>
-            </Problems>
-        </Body>
-    </ContinuityOfCareRecord>
-</entry>
-<entry>
-    <id>https://www.google.com/health/feeds/profile/default/Cl.aMWIH5VA</id>
-    <published>2008-09-29T03:13:34.996Z</published>
-    <updated>2008-09-29T03:13:34.997Z</updated>
-    <category scheme="http://schemas.google.com/g/2005#kind" term="http://schemas.google.com/health/kinds#profile"/>
-    <category scheme="http://schemas.google.com/health/item" term="Chickenpox Vaccine"/>
-    <category term="IMMUNIZATION"/>
-    <title type="text"/>
-    <content type="html"/>
-    <link rel="http://schemas.google.com/health/data#complete" type="application/atom+xml" href="https://www.google.com/health/feeds/profile/default/-/%7Bhttp%3A%2F%2Fschemas.google.com%2Fg%2F2005%23kind%7Dhttp%3A%2F%2Fschemas.google.com%2Fhealth%2Fkinds%23profile/%7Bhttp%3A%2F%2Fschemas.google.com%2Fhealth%2Fitem%7DChickenpox+Vaccine/IMMUNIZATION"/>
-    <link rel="self" type="application/atom+xml" href="https://www.google.com/health/feeds/profile/default/Cl.aMWIH5VA"/>
-    <link rel="edit" type="application/atom+xml" href="https://www.google.com/health/feeds/profile/default/Cl.aMWIH5VA"/>
-    <author>
-        <name>User Name</name>
-        <email>user@gmail.com</email>
-    </author>
-    <ContinuityOfCareRecord xmlns="urn:astm-org:CCR">
-        <CCRDocumentObjectID>KlhUqfftgELIitpKbqYalw</CCRDocumentObjectID>
-        <Language/>
-        <DateTime>
-            <Type/>
-        </DateTime>
-        <Patient/>
-        <Body>
-            <Immunizations>
-                <Immunization>
-                    <Type/>
-                    <Description/>
-                    <Status/>
-                    <Source>
-                        <Actor>
-                            <ActorID>user@gmail.com</ActorID>
-                            <ActorRole>
-                                <Text>Patient</Text>
-                            </ActorRole>
-                        </Actor>
-                    </Source>
-                    <Product>
-                        <ProductName>
-                            <Text>Chickenpox Vaccine</Text>
-                            <Code>
-                                <Value>21</Value>
-                                <CodingSystem>HL7</CodingSystem>
-                            </Code>
-                        </ProductName>
-                    </Product>
-                    <Directions>
-                        <Direction>
-                            <Description/>
-                            <DeliveryMethod/>
-                        </Direction>
-                    </Directions>
-                    <Refills/>
-                </Immunization>
-            </Immunizations>
-        </Body>
-    </ContinuityOfCareRecord>
-</entry>
-<entry>
-    <id>https://www.google.com/health/feeds/profile/default/l0a7.FlX3_0</id>
-    <published>2008-09-29T03:14:47.461Z</published>
-    <updated>2008-09-29T03:14:47.461Z</updated>
-    <category scheme="http://schemas.google.com/g/2005#kind" term="http://schemas.google.com/health/kinds#profile"/>
-    <category term="DEMOGRAPHICS"/>
-    <category scheme="http://schemas.google.com/health/item" term="Demographics"/>
-    <title type="text">Demographics</title>
-    <content type="html"/>
-    <link rel="http://schemas.google.com/health/data#complete" type="application/atom+xml" href="https://www.google.com/health/feeds/profile/default/-/%7Bhttp%3A%2F%2Fschemas.google.com%2Fg%2F2005%23kind%7Dhttp%3A%2F%2Fschemas.google.com%2Fhealth%2Fkinds%23profile/DEMOGRAPHICS/%7Bhttp%3A%2F%2Fschemas.google.com%2Fhealth%2Fitem%7DDemographics"/>
-    <link rel="self" type="application/atom+xml" href="https://www.google.com/health/feeds/profile/default/l0a7.FlX3_0"/>
-    <link rel="edit" type="application/atom+xml" href="https://www.google.com/health/feeds/profile/default/l0a7.FlX3_0"/>
-    <author>
-        <name>User Name</name>
-        <email>user@gmail.com</email>
-    </author>
-    <ContinuityOfCareRecord xmlns="urn:astm-org:CCR">
-        <CCRDocumentObjectID>U5GDAVOxFbexQw3iyvqPYg</CCRDocumentObjectID>
-        <Language/>
-        <DateTime>
-            <Type/>
-        </DateTime>
-        <Patient/>
-        <Body/>
-        <Actors>
-            <Actor>
-                <Person>
-                    <Name>
-                        <BirthName/>
-                        <CurrentName/>
-                    </Name>
-                    <DateOfBirth>
-                        <Type/>
-                        <ExactDateTime>1984-07-22</ExactDateTime>
-                    </DateOfBirth>
-                    <Gender>
-                        <Text>Male</Text>
-                    </Gender>
-                </Person>
-                <Status/>
-                <Source>
-                    <Actor>
-                        <ActorID>user@gmail.com</ActorID>
-                        <ActorRole>
-                            <Text>Patient</Text>
-                        </ActorRole>
-                    </Actor>
-                </Source>
-            </Actor>
-        </Actors>
-    </ContinuityOfCareRecord>
-</entry>
-<entry>
-    <id>https://www.google.com/health/feeds/profile/default/oIBDdgwFLyo</id>
-    <published>2008-09-29T03:14:47.690Z</published>
-    <updated>2008-09-29T03:14:47.691Z</updated>
-    <category scheme="http://schemas.google.com/g/2005#kind" term="http://schemas.google.com/health/kinds#profile"/>
-    <category term="DEMOGRAPHICS"/>
-    <category scheme="http://schemas.google.com/health/item" term="FunctionalStatus"/>
-    <title type="text">FunctionalStatus</title>
-    <content type="html"/>
-    <link rel="http://schemas.google.com/health/data#complete" type="application/atom+xml" href="https://www.google.com/health/feeds/profile/default/-/%7Bhttp%3A%2F%2Fschemas.google.com%2Fg%2F2005%23kind%7Dhttp%3A%2F%2Fschemas.google.com%2Fhealth%2Fkinds%23profile/DEMOGRAPHICS/%7Bhttp%3A%2F%2Fschemas.google.com%2Fhealth%2Fitem%7DFunctionalStatus"/>
-    <link rel="self" type="application/atom+xml" href="https://www.google.com/health/feeds/profile/default/oIBDdgwFLyo"/>
-    <link rel="edit" type="application/atom+xml" href="https://www.google.com/health/feeds/profile/default/oIBDdgwFLyo"/>
-    <author>
-        <name>User Name</name>
-        <email>user@gmail.com</email>
-    </author>
-    <ContinuityOfCareRecord xmlns="urn:astm-org:CCR">
-        <CCRDocumentObjectID>W.EJcnhxb7W5M4eR4Tr1YA</CCRDocumentObjectID>
-        <Language/>
-        <DateTime>
-            <Type/>
-        </DateTime>
-        <Patient/>
-        <Body>
-            <FunctionalStatus>
-                <Function>
-                    <Type>
-                        <Text>Pregnancy status</Text>
-                    </Type>
-                    <Description>
-                        <Text>Not pregnant</Text>
-                    </Description>
-                    <Status/>
-                    <Source>
-                        <Actor>
-                            <ActorID>user@gmail.com</ActorID>
-                            <ActorRole>
-                                <Text>Patient</Text>
-                            </ActorRole>
-                        </Actor>
-                    </Source>
-                </Function>
-                <Function>
-                    <Type>
-                        <Text>Breastfeeding status</Text>
-                    </Type>
-                    <Description>
-                        <Text>Not breastfeeding</Text>
-                    </Description>
-                    <Status/>
-                    <Source>
-                        <Actor>
-                            <ActorID>user@gmail.com</ActorID>
-                            <ActorRole>
-                                <Text>Patient</Text>
-                            </ActorRole>
-                        </Actor>
-                    </Source>
-                </Function>
-            </FunctionalStatus>
-        </Body>
-    </ContinuityOfCareRecord>
-</entry>
-<entry>
-    <id>https://www.google.com/health/feeds/profile/default/wwljIlXuTVg</id>
-    <published>2008-09-29T03:26:10.080Z</published>
-    <updated>2008-09-29T03:26:10.081Z</updated>
-    <category term="MEDICATION"/>
-    <category scheme="http://schemas.google.com/g/2005#kind" term="http://schemas.google.com/health/kinds#profile"/>
-    <category scheme="http://schemas.google.com/health/item" term="Lipitor"/>
-    <title type="text"/>
-    <content type="html"/>
-    <link rel="http://schemas.google.com/health/data#complete" type="application/atom+xml" href="https://www.google.com/health/feeds/profile/default/-/MEDICATION/%7Bhttp%3A%2F%2Fschemas.google.com%2Fg%2F2005%23kind%7Dhttp%3A%2F%2Fschemas.google.com%2Fhealth%2Fkinds%23profile/%7Bhttp%3A%2F%2Fschemas.google.com%2Fhealth%2Fitem%7DLipitor"/>
-    <link rel="self" type="application/atom+xml" href="https://www.google.com/health/feeds/profile/default/wwljIlXuTVg"/>
-    <link rel="edit" type="application/atom+xml" href="https://www.google.com/health/feeds/profile/default/wwljIlXuTVg"/>
-    <author>
-        <name>User Name</name>
-        <email>user@gmail.com</email>
-    </author>
-    <ContinuityOfCareRecord xmlns="urn:astm-org:CCR">
-        <CCRDocumentObjectID>OrpghzvvbG_YaO5koqT2ug</CCRDocumentObjectID>
-        <Language/>
-        <DateTime>
-            <Type/>
-        </DateTime>
-        <Patient/>
-        <Body>
-            <Medications>
-                <Medication>
-                    <Type/>
-                    <Description/>
-                    <Status>
-                        <Text>ACTIVE</Text>
-                    </Status>
-                    <Source>
-                        <Actor>
-                            <ActorID>user@gmail.com</ActorID>
-                            <ActorRole>
-                                <Text>Patient</Text>
-                            </ActorRole>
-                        </Actor>
-                    </Source>
-                    <Product>
-                        <ProductName>
-                            <Text>Lipitor</Text>
-                        </ProductName>
-                        <Strength>
-                            <Units/>
-                            <StrengthSequencePosition>0</StrengthSequencePosition>
-                            <VariableStrengthModifier/>
-                        </Strength>
-                    </Product>
-                    <Directions>
-                        <Direction>
-                            <Description/>
-                            <DeliveryMethod/>
-                            <Dose>
-                                <Units/>
-                                <DoseSequencePosition>0</DoseSequencePosition>
-                                <VariableDoseModifier/>
-                            </Dose>
-                            <Route>
-                                <Text>By mouth</Text>
-                                <Code>
-                                    <Value>C38288</Value>
-                                    <CodingSystem>FDA</CodingSystem>
-                                </Code>
-                                <RouteSequencePosition>0</RouteSequencePosition>
-                                <MultipleRouteModifier/>
-                            </Route>
-                        </Direction>
-                    </Directions>
-                    <Refills/>
-                </Medication>
-            </Medications>
-        </Body>
-    </ContinuityOfCareRecord>
-</entry>
-<entry>
-    <id>https://www.google.com/health/feeds/profile/default/dd09TR12SiY</id>
-    <published>2008-09-29T07:52:17.175Z</published>
-    <updated>2008-09-29T07:52:17.176Z</updated>
-    <category scheme="http://schemas.google.com/g/2005#kind" term="http://schemas.google.com/health/kinds#profile"/>
-    <category scheme="http://schemas.google.com/health/item" term="Malaria"/>
-    <category term="CONDITION"/>
-    <title type="text"/>
-    <content type="html"/>
-    <link rel="http://schemas.google.com/health/data#complete" type="application/atom+xml" href="https://www.google.com/health/feeds/profile/default/-/%7Bhttp%3A%2F%2Fschemas.google.com%2Fg%2F2005%23kind%7Dhttp%3A%2F%2Fschemas.google.com%2Fhealth%2Fkinds%23profile/%7Bhttp%3A%2F%2Fschemas.google.com%2Fhealth%2Fitem%7DMalaria/CONDITION"/>
-    <link rel="self" type="application/atom+xml" href="https://www.google.com/health/feeds/profile/default/dd09TR12SiY"/>
-    <link rel="edit" type="application/atom+xml" href="https://www.google.com/health/feeds/profile/default/dd09TR12SiY"/>
-    <author>
-        <name>User Name</name>
-        <email>user@gmail.com</email>
-    </author>
-    <ContinuityOfCareRecord xmlns="urn:astm-org:CCR">
-        <CCRDocumentObjectID>XF99N6X4lpy.jfPUPLMMSQ</CCRDocumentObjectID>
-        <Language/>
-        <DateTime>
-            <Type/>
-        </DateTime>
-        <Patient/>
-        <Body>
-            <Problems>
-                <Problem>
-                    <Type/>
-                    <Description>
-                        <Text>Malaria</Text>
-                        <Code>
-                            <Value>136.9</Value>
-                            <CodingSystem>ICD9_Broader</CodingSystem>
-                        </Code>
-                        <Code>
-                            <Value>084.6</Value>
-                            <CodingSystem>ICD9</CodingSystem>
-                        </Code>
-                    </Description>
-                    <Status>
-                        <Text>ACTIVE</Text>
-                    </Status>
-                    <Source>
-                        <Actor>
-                            <ActorID>user@gmail.com</ActorID>
-                            <ActorRole>
-                                <Text>Patient</Text>
-                            </ActorRole>
-                        </Actor>
-                    </Source>
-                    <HealthStatus>
-                        <Description/>
-                    </HealthStatus>
-                </Problem>
-            </Problems>
-        </Body>
-    </ContinuityOfCareRecord>
-</entry>
-<entry>
-    <id>https://www.google.com/health/feeds/profile/default/aS0Cf964DPs</id>
-    <published>2008-09-29T03:14:47.463Z</published>
-    <updated>2008-09-29T03:14:47.463Z</updated>
-    <category scheme="http://schemas.google.com/g/2005#kind" term="http://schemas.google.com/health/kinds#profile"/>
-    <category term="DEMOGRAPHICS"/>
-    <category scheme="http://schemas.google.com/health/item" term="SocialHistory (Drinking, Smoking)"/>
-    <title type="text">SocialHistory (Drinking, Smoking)</title>
-    <content type="html"/>
-    <link rel="http://schemas.google.com/health/data#complete" type="application/atom+xml" href="https://www.google.com/health/feeds/profile/default/-/%7Bhttp%3A%2F%2Fschemas.google.com%2Fg%2F2005%23kind%7Dhttp%3A%2F%2Fschemas.google.com%2Fhealth%2Fkinds%23profile/DEMOGRAPHICS/%7Bhttp%3A%2F%2Fschemas.google.com%2Fhealth%2Fitem%7DSocialHistory+%28Drinking%2C+Smoking%29"/>
-    <link rel="self" type="application/atom+xml" href="https://www.google.com/health/feeds/profile/default/aS0Cf964DPs"/>
-    <link rel="edit" type="application/atom+xml" href="https://www.google.com/health/feeds/profile/default/aS0Cf964DPs"/>
-    <author>
-        <name>User Name</name>
-        <email>user@gmail.com</email>
-    </author>
-    <ContinuityOfCareRecord xmlns="urn:astm-org:CCR">
-        <CCRDocumentObjectID>kXylGU5YXLBzriv61xPGZQ</CCRDocumentObjectID>
-        <Language/>
-        <DateTime>
-            <Type/>
-        </DateTime>
-        <Patient/>
-        <Body>
-            <SocialHistory>
-                <SocialHistoryElement>
-                    <Type>
-                        <Text>Race</Text>
-                        <Code>
-                            <Value>S15814</Value>
-                            <CodingSystem>HL7</CodingSystem>
-                        </Code>
-                    </Type>
-                    <Description>
-                        <Text>White</Text>
-                    </Description>
-                    <Status/>
-                    <Source>
-                        <Actor>
-                            <ActorID>user@gmail.com</ActorID>
-                            <ActorRole>
-                                <Text>Patient</Text>
-                            </ActorRole>
-                        </Actor>
-                    </Source>
-                    <Episodes>
-                        <Frequency>
-                            <Units/>
-                        </Frequency>
-                    </Episodes>
-                </SocialHistoryElement>
-            </SocialHistory>
-        </Body>
-    </ContinuityOfCareRecord>
-</entry>
-<entry>
-    <id>https://www.google.com/health/feeds/profile/default/s5lII5xfj_g</id>
-    <published>2008-09-29T03:14:47.544Z</published>
-    <updated>2008-09-29T03:14:47.545Z</updated>
-    <category scheme="http://schemas.google.com/health/item" term="VitalSigns"/>
-    <category scheme="http://schemas.google.com/g/2005#kind" term="http://schemas.google.com/health/kinds#profile"/>
-    <category term="DEMOGRAPHICS"/>
-    <title type="text">VitalSigns</title>
-    <content type="html"/>
-    <link rel="http://schemas.google.com/health/data#complete" type="application/atom+xml" href="https://www.google.com/health/feeds/profile/default/-/%7Bhttp%3A%2F%2Fschemas.google.com%2Fhealth%2Fitem%7DVitalSigns/%7Bhttp%3A%2F%2Fschemas.google.com%2Fg%2F2005%23kind%7Dhttp%3A%2F%2Fschemas.google.com%2Fhealth%2Fkinds%23profile/DEMOGRAPHICS"/>
-    <link rel="self" type="application/atom+xml" href="https://www.google.com/health/feeds/profile/default/s5lII5xfj_g"/>
-    <link rel="edit" type="application/atom+xml" href="https://www.google.com/health/feeds/profile/default/s5lII5xfj_g"/>
-    <author>
-        <name>User Name</name>
-        <email>user@gmail.com</email>
-    </author>
-    <ContinuityOfCareRecord xmlns="urn:astm-org:CCR">
-        <CCRDocumentObjectID>FTTIiY0TVVj35kZqFFjPjQ</CCRDocumentObjectID>
-        <Language/>
-        <DateTime>
-            <Type/>
-        </DateTime>
-        <Patient/>
-        <Body>
-            <VitalSigns>
-                <Result>
-                    <Type/>
-                    <Description/>
-                    <Status/>
-                    <Source>
-                        <Actor>
-                            <ActorID>user@gmail.com</ActorID>
-                            <ActorRole>
-                                <Text>Patient</Text>
-                            </ActorRole>
-                        </Actor>
-                    </Source>
-                    <Substance/>
-                    <Test>
-                        <Type/>
-                        <Description>
-                            <Text>Height</Text>
-                        </Description>
-                        <Status/>
-                        <TestResult>
-                            <ResultSequencePosition>0</ResultSequencePosition>
-                            <VariableResultModifier/>
-                            <Value>70</Value>
-                            <Units>
-                                <Unit>inches</Unit>
-                            </Units>
-                        </TestResult>
-                        <ConfidenceValue/>
-                    </Test>
-                </Result>
-                <Result>
-                    <Type/>
-                    <Description/>
-                    <Status/>
-                    <Source>
-                        <Actor>
-                            <ActorID>user@gmail.com</ActorID>
-                            <ActorRole>
-                                <Text>Patient</Text>
-                            </ActorRole>
-                        </Actor>
-                    </Source>
-                    <Substance/>
-                    <Test>
-                        <Type/>
-                        <Description>
-                            <Text>Weight</Text>
-                        </Description>
-                        <Status/>
-                        <TestResult>
-                            <ResultSequencePosition>0</ResultSequencePosition>
-                            <VariableResultModifier/>
-                            <Value>2480</Value>
-                            <Units>
-                                <Unit>ounces</Unit>
-                            </Units>
-                        </TestResult>
-                        <ConfidenceValue/>
-                    </Test>
-                </Result>
-                <Result>
-                    <Type/>
-                    <Description/>
-                    <Status/>
-                    <Source>
-                        <Actor>
-                            <ActorID>user@gmail.com</ActorID>
-                            <ActorRole>
-                                <Text>Patient</Text>
-                            </ActorRole>
-                        </Actor>
-                    </Source>
-                    <Substance/>
-                    <Test>
-                        <Type/>
-                        <Description>
-                            <Text>Blood Type</Text>
-                        </Description>
-                        <Status/>
-                        <TestResult>
-                            <ResultSequencePosition>0</ResultSequencePosition>
-                            <VariableResultModifier/>
-                            <Value>O+</Value>
-                            <Units/>
-                        </TestResult>
-                        <ConfidenceValue/>
-                    </Test>
-                </Result>
-            </VitalSigns>
-        </Body>
-    </ContinuityOfCareRecord>
-</entry>
-</feed>

+ 0 - 16
tests/Zend/Gdata/Health/_files/TestDataHealthProfileListEntrySample.xml

@@ -1,16 +0,0 @@
-<?xml version='1.0' encoding='utf-8'?>
-<entry xmlns='http://www.w3.org/2005/Atom'
-xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/'>
-  <id>
-  https://www.google.com/health/feeds/profile/list/vndCn5sdfwdEIY</id>
-  <updated>1970-01-01T00:00:00.000Z</updated>
-  <title type='text'>profile name</title>
-  <content type='text'>vndCn5sdfwdEIY</content>
-  <link rel='self' type='application/atom+xml'
-  href='https://www.google.com/health/feeds/profile/list/vndCn5sdfwdEIY' />
-  <link rel='edit' type='application/atom+xml'
-  href='https://www.google.com/health/feeds/profile/list/vndCn5sdfwdEIY' />
-  <author>
-    <name>user@gmail.com</name>
-  </author>
-</entry>

+ 0 - 21
tests/Zend/Gdata/Health/_files/ccr_notice_sample.xml

@@ -1,21 +0,0 @@
-<ContinuityOfCareRecord xmlns="urn:astm-org:CCR">
-  <Body>
-   <Problems>
-    <Problem>
-      <DateTime>
-        <Type><Text>Start date</Text></Type>
-        <ExactDateTime>2007-04-04T07:00:00Z</ExactDateTime>
-      </DateTime>
-      <Description>
-        <Text>Aortic valve disorders</Text>
-        <Code>
-          <Value>410.10</Value>
-          <CodingSystem>ICD9</CodingSystem>
-          <Version>2004</Version>
-        </Code>
-      </Description>
-      <Status><Text>Active</Text></Status>
-    </Problem>
-  </Problems>
-  </Body>
-</ContinuityOfCareRecord>

+ 0 - 317
tests/Zend/Gdata/HealthOnlineTest.php

@@ -1,317 +0,0 @@
-<?php
-/**
- * Zend Framework
- *
- * LICENSE
- *
- * This source file is subject to the new BSD license that is bundled
- * with this package in the file LICENSE.txt.
- * It is also available through the world-wide-web at this URL:
- * http://framework.zend.com/license/new-bsd
- * If you did not receive a copy of the license and are unable to
- * obtain it through the world-wide-web, please send an email
- * to license@zend.com so we can send you a copy immediately.
- *
- * @category   Zend
- * @package    Zend_Gdata_Health
- * @subpackage UnitTests
- * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
- * @license    http://framework.zend.com/license/new-bsd     New BSD License
- * @version    $Id $
- */
-
-require_once 'Zend/Gdata/Health.php';
-require_once 'Zend/Gdata/Health/Query.php';
-require_once 'Zend/Gdata/ClientLogin.php';
-
-/**
- * @category   Zend
- * @package    Zend_Gdata_Health
- * @subpackage UnitTests
- * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
- * @license    http://framework.zend.com/license/new-bsd     New BSD License
- * @group      Zend_Gdata
- * @group      Zend_Gdata_Health
- */
-class Zend_Gdata_HealthOnlineTest extends PHPUnit_Framework_TestCase
-{
-
-    public function setUp()
-    {
-        $this->user = constant('TESTS_ZEND_GDATA_CLIENTLOGIN_EMAIL');
-        $this->pass = constant('TESTS_ZEND_GDATA_CLIENTLOGIN_PASSWORD');
-        $serviceName = Zend_Gdata_Health::HEALTH_SERVICE_NAME;
-        $client = Zend_Gdata_ClientLogin::getHttpClient($this->user, $this->pass, $serviceName);
-        $this->health = new Zend_Gdata_Health($client, 'google-MyPHPApp-v1.0');
-    }
-
-    private function setupProfileID()
-    {
-        $profileListFeed = $this->health->getHealthProfileListFeed();
-        $profileID = $profileListFeed->entry[0]->getProfileID();
-        $this->health->setProfileID($profileID);
-    }
-
-    public function testSetProfileID()
-    {
-        $this->health->setProfileID('123456790');
-        $this->assertEquals('123456790', $this->health->getProfileID());
-    }
-
-    public function testGetHealthProfileListFeedWithoutUsingClientLogin()
-    {
-        $client = new Zend_Gdata_HttpClient();
-        $this->health = new Zend_Gdata_Health($client);
-
-        try {
-            $feed = $this->health->getHealthProfileListFeed();
-            $this->fail('Expecting to catch Zend_Gdata_App_AuthException');
-        } catch (Exception $e) {
-            $this->assertThat($e, $this->isInstanceOf('Zend_Gdata_App_AuthException'),
-                'Expecting Zend_Gdata_App_AuthException, got '.get_class($e));
-        }
-    }
-
-    public function testGetHealthProfileFeedWithoutUsingClientLogin()
-    {
-        try {
-            $feed = $this->health->getHealthProfileFeed();
-            $this->fail('Expecting to catch Zend_Gdata_App_AuthException');
-        } catch (Exception $e) {
-            $this->assertThat($e, $this->isInstanceOf('Zend_Gdata_App_AuthException'),
-                'Expecting Zend_Gdata_App_AuthException, got '.get_class($e));
-        }
-    }
-
-    public function testUseH9()
-    {
-        $serviceName = Zend_Gdata_Health::H9_SANDBOX_SERVICE_NAME;
-        $client = Zend_Gdata_ClientLogin::getHttpClient($this->user, $this->pass, $serviceName);
-        $h9 = new Zend_Gdata_Health($client, 'google-MyPHPApp-v1.0', true);
-
-        $profileListFeed = $h9->getHealthProfileListFeed();
-        $profileID = $profileListFeed->entry[0]->getProfileID();
-        $h9->setProfileID($profileID);
-
-        // query profile feed
-        $feed1 = $h9->getHealthProfileFeed();
-        $this->assertTrue($feed1 instanceof Zend_Gdata_Health_ProfileFeed);
-        foreach ($feed1->getEntries() as $entry) {
-            $this->assertTrue($entry instanceof Zend_Gdata_Health_ProfileEntry);
-            $this->assertEquals($entry->getHttpClient(), $feed1->getHttpClient());
-        }
-
-        // send CCR
-        $subject = "Title of your notice goes here";
-        $body = "Notice body can contain <b>html</b> entities";
-        $type = "html";
-        $ccrXML = file_get_contents('Zend/Gdata/Health/_files/ccr_notice_sample.xml', true);
-
-        $responseEntry = $h9->sendHealthNotice($subject, $body, $type, $ccrXML);
-
-        $this->assertTrue($responseEntry instanceof Zend_Gdata_Health_ProfileEntry);
-        $this->assertEquals($subject, $responseEntry->title->text);
-        $this->assertEquals($body, $responseEntry->content->text);
-        $this->assertEquals($type, $responseEntry->content->type);
-        $this->assertXmlStringEqualsXmlString($responseEntry->getCcr()->saveXML(), $ccrXML);
-    }
-
-    public function testGetHealthProfileListFeed()
-    {
-        // no query
-        $feed1 = $this->health->getHealthProfileListFeed();
-        $this->assertTrue($feed1 instanceof Zend_Gdata_Health_ProfileListFeed);
-        foreach ($feed1->getEntries() as $entry) {
-            $this->assertTrue($entry instanceof Zend_Gdata_Health_ProfileListEntry);
-            $this->assertEquals($entry->getHttpClient(), $feed1->getHttpClient());
-        }
-
-        // with query object
-        $query = new Zend_Gdata_Health_Query('https://www.google.com/health/feeds/profile/list');
-        $feed2 = $this->health->getHealthProfileListFeed($query);
-        $this->assertTrue($feed2 instanceof Zend_Gdata_Health_ProfileListFeed);
-        foreach ($feed2->entry as $entry) {
-            $this->assertTrue($entry instanceof Zend_Gdata_Health_ProfileListEntry);
-            $this->assertEquals($entry->getHttpClient(), $feed2->getHttpClient());
-        }
-
-        // with direct query string
-        $feed3 = $this->health->getHealthProfileListFeed('https://www.google.com/health/feeds/profile/list');
-        $this->assertTrue($feed3 instanceof Zend_Gdata_Health_ProfileListFeed);
-        foreach ($feed3->entry as $entry) {
-            $this->assertTrue($entry instanceof Zend_Gdata_Health_ProfileListEntry);
-            $this->assertEquals($entry->getHttpClient(), $feed3->getHttpClient());
-        }
-
-        $this->assertEquals($feed1->saveXML(), $feed2->saveXML());
-        $this->assertEquals($feed1->saveXML(), $feed3->saveXML());
-        $this->assertEquals($feed2->saveXML(), $feed3->saveXML());
-    }
-
-
-    public function testGetProfileFeedNoQuery()
-    {
-        $this->setupProfileID();
-
-        // no query, digest=false
-        $profileFeed = $this->health->getHealthProfileFeed();
-        $this->assertTrue($profileFeed instanceof Zend_Gdata_Health_ProfileFeed);
-        $this->assertTrue(count($profileFeed->entry) > 1, 'digest=false, should have multiple <entry> elements');
-        foreach ($profileFeed->entry as $entry) {
-            $this->assertTrue($entry instanceof Zend_Gdata_Health_ProfileEntry);
-            $ccr = $entry->getCcr();
-            $this->assertTrue($ccr instanceof Zend_Gdata_Health_Extension_Ccr);
-            $this->assertEquals($entry->getHttpClient(), $profileFeed->getHttpClient());
-        }
-    }
-
-    public function testGetProfileFeedByQuery()
-    {
-        $this->setupProfileID();
-        $profileID = $this->health->getProfileID();
-
-        // with direct query string
-        $feed1 = $this->health->getHealthProfileFeed(
-            "https://www.google.com/health/feeds/profile/ui/{$profileID}?digest=true");
-        $this->assertTrue($feed1 instanceof Zend_Gdata_Health_ProfileFeed);
-        $this->assertTrue(count($feed1->entry) === 1, 'digest=true, expected a single <entry> element');
-        foreach ($feed1->entry as $entry) {
-            $this->assertTrue($entry instanceof Zend_Gdata_Health_ProfileEntry);
-            $ccr = $entry->getCcr();
-            $this->assertTrue($ccr instanceof Zend_Gdata_Health_Extension_Ccr);
-            $this->assertEquals($entry->getHttpClient(), $feed1->getHttpClient());
-        }
-
-        // with query object
-        $query = new Zend_Gdata_Health_Query("https://www.google.com/health/feeds/profile/ui/{$profileID}");
-        $query->setDigest('true');
-        $feed2 = $this->health->getHealthProfileFeed($query);
-        $this->assertTrue($feed2 instanceof Zend_Gdata_Health_ProfileFeed);
-        $this->assertTrue(count($feed2->entry) === 1, 'digest=true, expected a single <entry> element');
-        foreach ($feed2->entry as $entry) {
-            $this->assertTrue($entry instanceof Zend_Gdata_Health_ProfileEntry);
-            $ccr = $entry->getCcr();
-            $this->assertTrue($ccr instanceof Zend_Gdata_Health_Extension_Ccr);
-            $this->assertEquals($entry->getHttpClient(), $feed2->getHttpClient());
-        }
-
-        $this->assertEquals($feed1->saveXML(), $feed2->saveXML());
-    }
-
-    public function testGetProfileEntryNoQuery()
-    {
-        try {
-            $entry = $this->health->getHealthProfileEntry();
-            $this->fail('Expecting to catch Zend_Gdata_App_InvalidArgumentException');
-        } catch (Exception $e) {
-            $this->assertThat($e, $this->isInstanceOf('Zend_Gdata_App_InvalidArgumentException'),
-                'Expecting Zend_Gdata_App_InvalidArgumentException, got '.get_class($e));
-        }
-    }
-
-    public function testGetProfileEntry()
-    {
-        $this->setupProfileID();
-        $profileID = $this->health->getProfileID();
-
-        $feed = $this->health->getHealthProfileFeed();
-        $entryFromProfileQuery = $feed->entry[0];
-        $this->assertTrue($entryFromProfileQuery instanceof Zend_Gdata_Health_ProfileEntry);
-
-        // direct query string
-        $entry1 = $this->health->getHealthProfileEntry($entryFromProfileQuery->id->text);
-        $this->assertTrue($entry1 instanceof Zend_Gdata_Health_ProfileEntry);
-
-        // query object
-        $query = new Zend_Gdata_Health_Query("https://www.google.com/health/feeds/profile/ui/{$profileID}");
-        $entry2 = $this->health->getHealthProfileEntry($query);
-        $this->assertTrue($entry2 instanceof Zend_Gdata_Health_ProfileEntry);
-
-        $this->assertEquals($entryFromProfileQuery->getHttpClient(), $entry1->getHttpClient());
-        $this->assertEquals($entryFromProfileQuery->getHttpClient(), $entry2->getHttpClient());
-        $this->assertEquals($entry1->getHttpClient(), $entry2->getHttpClient());
-
-        $this->assertXmlStringEqualsXmlString($entryFromProfileQuery->getCcr()->saveXML(), $entry1->getCcr()->saveXML());
-        $this->assertXmlStringEqualsXmlString($entryFromProfileQuery->getCcr()->saveXML(), $entry2->getCcr()->saveXML());
-        $this->assertXmlStringEqualsXmlString($entry1->getCcr()->saveXML(), $entry2->getCcr()->saveXML());
-    }
-
-    public function testSendNoticeWithoutUsingClientLogin()
-    {
-        try {
-            $responseEntry = $this->health->sendHealthNotice("", "");
-            $this->fail('Expecting to catch Zend_Gdata_App_AuthException');
-        } catch (Exception $e) {
-            $this->assertThat($e, $this->isInstanceOf('Zend_Gdata_App_AuthException'),
-                'Expecting Zend_Gdata_App_AuthException, got '.get_class($e));
-        }
-    }
-
-    public function testSendNoticeWithoutCcr()
-    {
-        $this->setupProfileID();
-        $profileID = $this->health->getProfileID();
-
-        $subject = "Title of your notice goes here";
-        $body = "Notice body goes here";
-
-        $responseEntry = $this->health->sendHealthNotice($subject, $body);
-
-        $this->assertTrue($responseEntry instanceof Zend_Gdata_Health_ProfileEntry);
-        $this->assertEquals($subject, $responseEntry->title->text);
-        $this->assertEquals($body, $responseEntry->content->text);
-        $this->assertNull($responseEntry->getCcr());
-    }
-
-    public function testSendNoticeWithoutCcrUsingDirectInsert()
-    {
-        $this->setupProfileID();
-        $profileID = $this->health->getProfileID();
-
-        $subject = "Title of your notice goes here";
-        $body = "Notice body goes here";
-
-        $entry = new Zend_Gdata_Health_ProfileEntry();
-
-        $author = $this->health->newAuthor();
-        $author->name = $this->health->newName('John Doe');
-        $author->email = $this->health->newEmail('user@example.com');
-        $entry->setAuthor(array(0 => $author));
-
-        $entry->title = $this->health->newTitle($subject);
-        $entry->content = $this->health->newContent($body);
-        $entry->content->type = 'text';
-
-        $ccrXML = file_get_contents('Zend/Gdata/Health/_files/ccr_notice_sample.xml', true);
-        $entry->setCcr($ccrXML);
-
-        $uri = "https://www.google.com/health/feeds/register/ui/{$profileID}";
-        $responseEntry = $this->health->insertEntry($entry, $uri, 'Zend_Gdata_Health_ProfileEntry');
-
-        $this->assertTrue($responseEntry instanceof Zend_Gdata_Health_ProfileEntry);
-        $this->assertEquals($subject, $responseEntry->title->text);
-        $this->assertEquals($author->name->text, 'John Doe');
-        $this->assertEquals($author->email->text, 'user@example.com');
-        $this->assertEquals($body, $responseEntry->content->text);
-    }
-
-    public function testSendNoticeWithCcr()
-    {
-        $this->setupProfileID();
-        $profileID = $this->health->getProfileID();
-
-        $subject = "Title of your notice goes here";
-        $body = "Notice body can contain <b>html</b> entities";
-        $type = "html";
-        $ccrXML = file_get_contents('Zend/Gdata/Health/_files/ccr_notice_sample.xml', true);
-
-        $responseEntry = $this->health->sendHealthNotice($subject, $body, $type, $ccrXML);
-
-        $this->assertTrue($responseEntry instanceof Zend_Gdata_Health_ProfileEntry);
-        $this->assertEquals($subject, $responseEntry->title->text);
-        $this->assertEquals($body, $responseEntry->content->text);
-        $this->assertEquals($type, $responseEntry->content->type);
-        $this->assertXmlStringEqualsXmlString($responseEntry->getCcr()->saveXML(), $ccrXML);
-    }
-}
-