尿分叉吃什么药能治好| jeep是什么意思| 减肥适合吃什么主食| 拾到什么意思| 1992年五行属什么| 男人硬不起来该吃什么药| 大暑是什么意思啊| aa什么意思| 异常出汗是什么原因| 乌鸡煲汤放什么材料| 肛门不舒服是什么原因| tct检查什么项目| 眼睛为什么老是流眼泪| 炒菜用什么油| 二十不惑什么意思| 暗物质和暗能量是什么| 岱字五行属什么| 甲醛中毒有什么症状| 童子尿能治什么病| 什么是嗜睡| 脑梗什么原因导致的| 山楂和什么一起泡水喝| 颈椎病挂什么科| 春天有什么动物| 肾火旺吃什么药| 副团级是什么军衔| 艾灸有什么好处| 为什么脚上会长鸡眼| 月经期间肚子疼是什么原因| lomo卡是什么| 黄金是什么| 印鉴是什么意思| 心悸吃什么中成药| 葵水是什么意思| 1987年属什么今年多大| 1月1日是什么节| 什么东西人们都不喜欢吃| 噩耗是什么意思| 什么叫牙周炎| 上海市委书记什么级别| 共青团书记是什么级别| 农历五月十八是什么星座| 家去掉一点念什么| 房中术是什么意思| 养胃吃什么水果| 孩子为什么要躲百天| 红烧肉是什么菜系| 11月10日是什么星座| 长骨刺是什么原因导致的| 川字属于五行属什么| 墨西哥说什么语言| 食指有痣代表什么意思| 着凉嗓子疼吃什么药| 乙肝携带者是什么意思| 碧色是什么颜色| 阴茎不硬是什么原因| 梦见梳头发是什么意思| 王的五行属性是什么| 仓鼠突然死了是为什么| 走马观花的走什么意思| 黄色配什么颜色| 发烧能吃什么食物| 用盐刷牙有什么好处和坏处| 上火了吃什么食物降火| samsung是什么牌子| 枸杞泡茶有什么功效| 教师节属什么生肖| 胆结石有什么症状有哪些| 包拯属什么生肖| 补维生素吃什么好| 膝盖酸软是什么原因| 姨妈可以吃什么水果| 扎马步有什么好处| 自信是什么意思| 血压低会导致什么后果| 拔牙之后可以吃什么| 大排畸是什么检查| 吃什么能补雌激素| 女性支原体阳性是什么意思| 海的尽头是什么| 对辣椒过敏有什么症状| 月经期适合吃什么水果| 吃猪心有什么好处和坏处| 什么是幼小衔接| 看见双彩虹有什么征兆| 克拉霉素主治什么病| 双相情感障碍什么意思| 胃肠功能紊乱是什么意思| 玩票是什么意思| 羊水偏多是什么原因| 隐忍是什么意思| 空孕囊是什么原因造成的| 射手座男生喜欢什么样的女生| 雷锋原名叫什么| 为什么冬吃萝卜夏吃姜| 外阴长水泡是什么原因| 最大的海是什么海| 峦读什么| 背部毛孔粗大是什么原因| 甲亢是什么症状| 遗精频繁是什么原因| 反复口腔溃疡是什么病的前兆| 额头出汗多是什么原因| 火龙果和什么不能一起吃| 中元节开什么生肖| 诸葛亮姓什么| 咳嗽痰多是什么原因| 性功能减退吃什么药好| 荷花象征什么| 女性尿路感染挂什么科| 肌张力障碍是什么病| 绩效工资是什么意思| 符号是什么意思| 三色线分别代表什么| 胃癌是什么原因引起的| 伽利略是什么学家| 补阳气吃什么| 什么是好朋友| 蚊子喜欢什么颜色| 急性扁桃体发炎吃什么药| 凉拌菜用什么醋最好| 拍花子是什么意思| 多读书有什么好处| 梦见打死黄鼠狼是什么意思| 痤疮用什么药膏最有效| 女人梦见桃子预示什么| 今年85岁属什么生肖| 草头是什么菜| 耳鸣是什么感觉| 退工单是什么| 三和大神什么意思| 做喉镜能检查出什么病| 什么食物热量高| 幼稚是什么意思| 俯卧撑有什么好处| 皮肤糖化是什么意思| 麻瓜是什么意思| 开拔是什么意思| 瞎子吃核桃砸了手是什么生肖| 活塞是什么| 人体缺钾会有什么症状| 怂人是什么意思| 农历十月十八是什么星座| 大象的耳朵有什么作用| bkg是什么意思| 朋友圈为什么发不出去| 肝疼是什么原因| 宝宝低烧是什么原因引起的| 音高是什么意思| 痛风吃什么药治疗最有效| 龛是什么意思| 摆架子是什么意思| 什么桥下没有水| 优生十项是检查什么| 处女和什么座最配对| 什么体质的人才有季经| 胰岛素起什么作用| 颠茄片是什么药| 炖鸽子汤放什么调料| 一什么水壶| 属猪和什么属相相冲| 对药物过敏是什么症状| 啤酒对身体有什么好处| 什么是粒子植入治疗| 蟹粉是什么| 脸上肉跳动是什么原因| 农历五月十九是什么日子| 戌是什么生肖| 生吃大蒜有什么好处| 试商是什么意思| 一个月来两次月经是什么原因| 手爱出汗是什么原因| 经常吃豆腐有什么好处和坏处| 头疼去医院挂什么科| cb什么意思| 痛心疾首的疾什么意思| 孕妇吃鸽子蛋对胎儿有什么好处| 怀孕两个月有什么症状| 结扎对女人有什么伤害| 开胃菜都有什么| 四维彩超主要检查什么| 核糖体由什么组成| 二月二十二日是什么星座| 约炮是什么意思| 什么茶不能喝| 倾国倾城是什么生肖| 镇团委书记是什么级别| 大便每天四五次是什么病| 骨骼肌率是什么意思| 下身痒是什么原因| 吃什么水果降火| 沙果是什么水果| 什么食物含硒| bace是什么意思| 屎是什么味道| 月经正常颜色是什么色| 敌对是什么意思| 额头出汗多是什么原因| 为什么屎是黑色的| 2024年属什么年| 白细胞低吃什么药可以增加白细胞| 黄体生成素高是什么原因| 什么是跳蛋| 初三什么时候毕业| 血脂四项包括什么| 头孢过敏用什么药代替| 粪便隐血试验弱阳性是什么意思| 什么药止汗效果最好| 孔雀的尾巴有什么作用| 隐翅虫咬了用什么药| 叶酸片有什么功效| 什么牌子的蓝牙耳机好| 饭铲头是什么蛇| 知鸟吃什么| 岛屿是什么| 推介是什么意思| 右胸上部隐痛什么原因| 146是什么意思| 定投是什么意思| 尿酸高会引起什么疾病| 肝阴不足吃什么中成药| 什么是佝偻病有什么症状| blackpink什么意思| 缺维生素d吃什么| 孕妇痔疮犯了能用什么药膏| 咽喉炎吃什么药| hpv感染是什么病| 胳肢窝痒是什么原因| ricoh什么牌子| rca是什么意思| 唐氏筛查临界风险是什么意思| 呼吸道感染用什么药| 释怀和释然有什么区别| 抗磷脂综合征是什么病| 舌头疼吃什么药好得快| 脚浮肿吃什么药| ems什么意思| 禅心是什么意思| 八股是什么意思| 陈皮泡水喝有什么作用| 直博是什么意思| 妤是什么意思| 有什么神话故事| 盐和小苏打一起有什么作用| 口苦吃什么药好| 石斛的作用是什么| 布洛芬吃多了有什么后果| 透析是什么意思啊| 不应期是什么意思| 阴道镜是检查什么的| 膀胱炎挂什么科| 应接不暇的暇是什么意思| bata鞋属于什么档次| 什么地制宜| 九地是什么中药| 什么数字最听话| 为什么打哈欠会流眼泪| 女人嘴唇发紫是什么病| 美国为什么不敢动朝鲜| 吃什么食物补脾虚| 匡威属于什么档次| 阴虚内热是什么意思| 性生活后尿路感染是什么原因| 公积金缴存基数什么意思| 百度

View in English

  • Global Nav Open Menu Global Nav Close Menu
  • Apple Developer
Search
Cancel
  • Apple Developer
  • News
  • Discover
  • Design
  • Develop
  • Distribute
  • Support
  • Account
Only search within “”

Quick Links

5 Quick Links

Videos

Open Menu Close Menu
  • Collections
  • Topics
  • All Videos
  • About

More Videos

  • About
  • Transcript
  • 中国民用航空"十二五"发展规划

    百度   依照《中华人民共和国刑法》、《中华人民共和国监察法》、《最高人民法院、最高人民检察院关于办理贪污贿赂刑事案件适用法律若干问题的解释》的规定,法院判决被告人杨某蓝犯受贿罪,判处有期徒刑二年六个月,并处罚金十万元;被告人杨某蓝退缴的违法所得共计万元,予以没收,上缴国库(由广州市白云区监察委员会执行)。

    Learn how ResearchKit and CareKit can work together to take the tedium out of paper surveys. Continue coding along with us and explore how you can make it easier than ever to schedule surveys for your study participants. You'll also learn advanced techniques for crafting evolving regiments in CareKit and see how ResearchKit's active tasks can help capture important measurements out of clinic. This is the second session in a three-part Code-Along series. To get the most out of this session, we recommend first watching “Build a research and care app, part 1.” And for more background on these frameworks, watch "ResearchKit and CareKit Reimagined” from WWDC19.

    Resources

    • HealthKit
    • Research and care app code-along source repository
    • Research and Care Website
      • HD Video
      • SD Video

    Related Videos

    WWDC21

    • Build a research and care app, part 1: Setup onboarding
    • Build a research and care app, part 3: Visualize progress
  • Search this video…

    ? Bass music playing ? ? Erik Hornberger: Welcome back to the research and care app code-along! This is part two of our three-part series where you and I will build out a physical therapy app for our friend Jamie. If you'd like to follow along, you can find our project in the session resources. I'll just go ahead and get logged in here. If you joined us for session one, you'll recall that we just finished onboarding and consent. In this session -- Oh, hang on. It looks like we've got a message from Jamie. "Got some new ideas for the app." "Did you see my last text?" Additional app requirements. Jamie has invited you to collaborate on a Notes document. OK, well, let's just see what we're going to be doing this time! Displaying forms, persisting some data, dynamic schedules, range of motion. OK. So it looks like Jamie wants us to set up a daily check-in survey where we ask the participants about how much sleep they got and how much pain they're experiencing. We'll show you how to use ResearchKit's form items to put multiple questions on a single page. Then, we'll need to parse the results from the ResearchKit survey and persist them into CareKit. That'll cause our completion rings to fill up and our task card UI to update. We'll also go into detail on how to create more advanced schedules with CareKit, and then we'll use one of those schedules -- along with ResearchKit -- to prompt participants to measure the range of motion in their knees. We've got a lot to cover here, so let's jump in! We'll get started with the daily check-in survey. Just like we did for our onboarding task, we'll begin by defining a schedule and a CareKit task. It's supposed to be a daily check-in, so let's just schedule it to happen each morning at, say, 8:00 am. We'll create the check-in task with a unique identifier and the schedule we just defined. And of course, we'll need to persist it here in our store. This is all exactly the same as what we did for the onboarding task. Hopefully it's starting to feel familiar to you! And just like the onboarding task, our next step will be to jump over to CareFeedViewController and tell CareKit how to display this task. This time around, let's make our solution a bit more generic. We'll fetch all the tasks for the current date. Then for each task, we'll create a view controller, and append that view controller into our list. This should scale a bit more nicely as we add more tasks. Now, we haven't actually defined this fetchTasks method or this viewController method. We'll need to drop down a bit further in our file and write them out. So here's our fetchTasks method. We start by creating a task query for a specific date, and we specify that we want to exclude tasks that don't have any scheduled events. This comes into play when we have tasks that don't happen every day. Let's say, for example, you've been given a prescription to take a medication every Monday. On Tuesdays and Wednesdays, that prescription is still assigned to you, there just aren't any pills to take. This property ensures that such tasks are not returned from the query. Once the query comes back, we'll pass the tasks we fetched to our completion handler. We'll also need to fill out a method that takes a task and returns a view controller. We'll inspect the id of the task, and if it's the checkIn task, we'll use the new SurveyTaskViewController we introduced in part one. Just like before, we'll supply a task, an eventQuery, and a reference to the storeManager. We'll also need to pass in a ResearchKit survey and a function for converting the ResearchKit result into an array of CareKit outcome values. We'll write these two methods in just a moment, but first let's take a look at how our app, ResearchKit, and CareKit are going to work together. Our app will create a ResearchKit survey. ResearchKit will take over and guide the participant through the survey flow. It will produce an ORKTaskResult, which it will hand back to our app. Then our app will convert the ResearchKit result into CareKit outcome values to be persisted in CareKit's store. Saving a new outcome will cause our completion rings to fill up and our task cards' UIs to update. All right, so let's tackle these two methods. We'll define them over in Surveys.swift. I've prepared a couple of identifiers that we'll be using down below. We need one method for creating a ResearchKit survey and one for converting the result into CareKit outcome values. We want to discover if there is a link between the amount of sleep a participant gets and how much pain they experience, so we'll create a form with two questions. The formStep requires a unique identifier, a title, and some text. We'll also mark it nonoptional, since we don't want the form to be skippable. Next, let's create our two items. The first will inquire about pain, and we'll make it a nonoptional question. What that means is that the form itself cannot be skipped, nor can we submit the form without an answer to this particular question. You can see that we also need to provide an answer format. The answer format tells ResearchKit what kind of answer to expect and how to prompt the user to enter it. Are they entering a weight, are they selecting an image, or are they recording their voice? In this case, we'll opt to use the ORKScaleAnswerFormat, which creates a UISlider. Sliders are a familiar interface to iOS users; they're intuitive, and they provide a much nicer experience than filling in circles on a paper survey. We'll specify a maximum pain score of 10, a minimum value of 1, set the step size to 1 so that only round numbers are allowed, and provide descriptions of the min and the max values. All right, let's drop down a little further and create one more item: a sleepItem. This is almost exactly the same as the painItem, and we'll use a nearly identical answer format as well. The only difference is the identifier, and that we've changed the min to 0 hours of sleep and the max to 12 hours of sleep. Now we just need to pass these two items into our form item, then create an ORKOrderedTask with a single formStep. The second function is supposed to take a ResearchKit task result and create an array of CareKit values to persist. But before we write this code, let's take a look at the structure of a ResearchKit task result so that we have a better idea of how to parse it. It's important to understand that ORKTaskResults are nested types. We want to start at the root result for the check-in survey and then drill down to the checkin.form. The checkin.form has two children itself, and we'll need to dig down to each of them. First, we want to find the answers given for the pain item identifier and then for the sleep item identifier. We know those are both scale question results, and we can get the scale answers off of them. In this example, 4 and 11. So that's what it looks like visually, and this is what the same process looks like in code. Starting at the root result, we find the first child that is marked with the form identifier. That result will have its own children, and we can extract all of the children with the type ORKScaleQuestionResult, of which we know there will be two. The pain answer is the first one marked with the pain identifier, and the sleep answer is the first one marked with the sleep identifier. Both will have scaleAnswer properties. Once we have the answers in hand, we need to convert them into a CareKit outcome value -- one for sleep and one for pain. The kind property here is optional. You don't need to set it, but it can be helpful if you want to look up a value later. We'll see why this is useful in part three! The last thing that we need to do is return our two values from this function. With all that in place, our daily check-in should be good to go! Let's run the app and see how we're doing. Note that we have already completed onboarding in part one, so we don't need to go through the consent flow again. This is the true content of our app, and the CareKit check-in task we've just created is right where we expect it to be. Tapping on the card takes us into the ResearchKit survey. We'll just go ahead and give some answers here. Let's go with, like, say, a 4 for pain and we'll go with 8 hours of sleep. When we get back to our Care Feed, we can see that the completion ring at the top fills up, indicating that the answers from ResearchKit were successfully parsed into CareKit. This is looking really good. So we've finished our check-in survey with its multiquestion form, and we've verified that data is persisted into CareKit the way that we want it to be. That means we're about halfway there! It's time to move on to advanced schedules in CareKit, which we'll later apply to our range of motion task. Like the check-in task and the onboarding task before it, the first step is to define a schedule. But we're going to do something a bit more involved for this one. Jamie has asked that we reduce how often we ask participants to measure their range of motion as time goes on. Specifically, we want to set up a schedule that prompts the participant to measure their range of motion every day for the first week, but then, only once a week until the end of the month, and then never again after that. So once a day for the first week, then once a week for the rest of the month. Let's begin by defining a few key dates: thisMorning, nextWeek, and nextMonth. Now, if you want to create more nuanced schedules in CareKit, OCKScheduleElement is the tool for the job. Schedule elements have a start date, an end date, and repeat at some interval during that period. The dailyElement here starts this morning, ends next week, and repeats every day. The second element is the weeklyElement. It starts next week, ends next month, and repeats every week. Now that we have our two elements, we can compose them together to create a compound schedule, and then we can create a new range of motion task using that schedule. Of course, we'll need to add it into our store as well. Just like our other tasks, the next step is to hop back into our CareFeed and specify how we want CareKit to display this task. Once again, we'll use the SurveyTaskViewController, and we'll need to supply a survey, as well as functions, to extract the answers. Let's jump back into Surveys.swift and stub those out to provide a bit of structure before we get started. OK, so the range of motion task is actually pretty simple. As a matter of fact, it's built into ResearchKit as a predefined task. We just need to give it an identifier and specify which knee is to be measured. Now the predefined task has a completion step built into it, and the message it shows is a reasonable default, but we'd really like to show a custom message tailored to our use case. So we're going to tell ResearchKit to omit the standard completion step. Then, we'll define our own and give it an encouraging message specifically related to physical therapy. So that's the first function. The second one is where we'll convert from a ResearchKit result to CareKit outcome values. Hopefully this is starting to feel familiar now. There are a lot of ways we can go about this, but today we're going to dig down until we get to the first range of motion result. And we know there will only be one. Range of motion results actually have a bunch of useful properties on them, but the one we're most interested in for our use case is range, which measures how far the participant was able to bend their knee in degrees. We can use the kind field along with key paths to make it easy to look up this value later. That's foreshadowing for part three, by the way. All right, and that wraps up our function for extracting the outcome values. Nice! I think we're all set up. Let's run our app and I'll show you how it all works. The first thing that we want to check is that our schedule is working the way that we intend it to. The Range Of Motion task should show up every day during the first week. As I page through the 8th, and the 9th, and the 10th, the range of motion task shows up every day. But when I get out to next week, it stops showing up except on Monday here, which is the one day of the week that we still want it to appear. Here it's still showing up only once per week. But if we go out even further into the future, all the way to next month, it doesn't show up at all anymore. CareKit schedules are a great way to preprogram regimens like this. Let's jump back to today and try this out.

    When I tap Begin, our instructions step helps me understand what to do. When I start, Siri will give me audio guidance, so I'm just going to follow her instructions. Siri: Place your device on your left knee. Tap the screen and extend your left knee as far as you can. Touch anywhere to continue. When you are done, return your left knee to the start position, then tap anywhere. Erik: Nice. That's pretty neat, right? Usually you'd have to make a visit to the doctor's office and a therapist would help you take measurements like this, but ResearchKit can help participants take measurements in their own homes. I think Jamie will be really impressed with the progress we've made. I'll FaceTime him right after this and send him the latest version of our app on TestFlight. While I'm bringing Jamie up to speed on our progress, you can find more info about our frameworks on researchandcare.org, or read through the source code on GitHub. In session one, we set up onboarding. In this session, we scheduled a pair of tasks. Join us again for our third and final session to see how ResearchKit and CareKit can help us finish up our app. See you soon! ?

Developer Footer

  • Videos
  • WWDC21
  • Build a research and care app, part 2: Schedule tasks
  • Open Menu Close Menu
    • iOS
    • iPadOS
    • macOS
    • tvOS
    • visionOS
    • watchOS
    Open Menu Close Menu
    • Swift
    • SwiftUI
    • Swift Playground
    • TestFlight
    • Xcode
    • Xcode Cloud
    • SF Symbols
    Open Menu Close Menu
    • Accessibility
    • Accessories
    • App Extensions
    • App Store
    • Audio & Video
    • Augmented Reality
    • Design
    • Distribution
    • Education
    • Fonts
    • Games
    • Health & Fitness
    • In-App Purchase
    • Localization
    • Maps & Location
    • Machine Learning
    • Open Source
    • Security
    • Safari & Web
    Open Menu Close Menu
    • Documentation
    • Tutorials
    • Downloads
    • Forums
    • Videos
    Open Menu Close Menu
    • Support Articles
    • Contact Us
    • Bug Reporting
    • System Status
    Open Menu Close Menu
    • Apple Developer
    • App Store Connect
    • Certificates, IDs, & Profiles
    • Feedback Assistant
    Open Menu Close Menu
    • Apple Developer Program
    • Apple Developer Enterprise Program
    • App Store Small Business Program
    • MFi Program
    • News Partner Program
    • Video Partner Program
    • Security Bounty Program
    • Security Research Device Program
    Open Menu Close Menu
    • Meet with Apple
    • Apple Developer Centers
    • App Store Awards
    • Apple Design Awards
    • Apple Developer Academies
    • WWDC
    Get the Apple Developer app.
    Copyright ? 2025 Apple Inc. All rights reserved.
    Terms of Use Privacy Policy Agreements and Guidelines
    白发用什么染发最安全 餐巾纸属于什么垃圾 骨质硬化是什么意思 甲状腺用什么药 腔隙性脑梗吃什么药
    心脏不舒服挂什么科室 体重什么时候称最准确 许久是什么意思 骨骼惊奇什么意思 耀字五行属什么
    白血球高是什么原因 发呆表情是什么意思 为什么会长黄褐斑 兔死狗烹是什么生肖 观音菩萨原名叫什么名
    白发用什么染发最安全 这是什么颜色 太阳星座是什么意思 gb10769是什么标准 行尸走肉是什么意思
    岑岑是什么意思hcv8jop9ns1r.cn 女人出轨有什么表现hcv8jop6ns7r.cn 常吐痰是什么原因hcv9jop3ns5r.cn 查激素六项挂什么科hcv8jop6ns2r.cn 凭什么sscsqa.com
    女儿红是什么酒hcv8jop4ns9r.cn 什么是射频治疗hcv9jop1ns4r.cn 浑身痒是什么原因hcv8jop4ns4r.cn 经常喝饮料有什么危害hcv7jop4ns7r.cn 吃甲硝唑有什么副作用hcv8jop4ns8r.cn
    白羊座跟什么星座最配hcv8jop8ns2r.cn 麦冬长什么样子图片hcv7jop6ns3r.cn otc是什么药liaochangning.com 审美观是什么意思xianpinbao.com 紧锣密鼓是什么意思hcv9jop0ns3r.cn
    黄芪泡水喝有什么好处hcv9jop7ns4r.cn 蚂蟥是什么hcv7jop9ns6r.cn 急性腮腺炎吃什么药hcv9jop7ns9r.cn medium什么意思hcv7jop5ns0r.cn 宽慰是什么意思hcv7jop9ns1r.cn
    百度